Tripadvisor Interview Question

Find the largest sum of contiguous numbers in an array

Interview Answers

Anonymous

Jul 26, 2012

What about negative numbers in the array - you can't just sum it up

2

Anonymous

Feb 12, 2013

maximum subarray algorithm http://en.wikipedia.org/wiki/Maximum_subarray_problem

1

Anonymous

Oct 21, 2014

Dynamic programming

Anonymous

Jul 26, 2012

The key word is "contiguous" - the solution above will nto work. Just google the solution - there are quite few options here.