Facebook Interview Question
348 Interview Reviews |
Back to all Facebook Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Intern at Facebook:
Helpful Question?
Yes |
No
Inappropriate?



0 of 0 people found this helpful
by Hussein:
for(i = 1; i < arr.size(); i++) {
if(dp[i-1]+arr[i] > arr[i]) dp[i] = dp[i-1]+arr[i];
else dp[i] = arr[i];
}
for(int i = 0; i < dp.size(); i++) cout << dp[i] << endl;