Pergunta de entrevista da empresa Tripadvisor

Find the largest sum of contiguous numbers in an array

Respostas da entrevista

Sigiloso

26 de jul. de 2012

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

2

Sigiloso

12 de fev. de 2013

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

1

Sigiloso

21 de out. de 2014

Dynamic programming

Sigiloso

26 de jul. de 2012

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