Pergunta de entrevista da empresa Expedia Group

Find the largest positive contiguous sum in a given array of ints(positive and negative ints) in linear time complexity.

Respostas da entrevista

Sigiloso

4 de mar. de 2012

Use dynamic programming!

Sigiloso

8 de set. de 2013

This is Kadane’s Algorithm http://www.geeksforgeeks.org/largest-sum-contiguous-subarray/ http://en.wikipedia.org/wiki/Kadane%27s_Algorithm