Saturday, May 12, 2012

Find the largest contingent array in an array of integers.

A common interview question on Algorithms is to find the set of elements from an Array which has maximum sum.
In other words it is “Find the largest contingent array in an array of integers.”.

You can achieve it in only 3 lines of logical code/algorithm.
I am here pasting the C# solution code for the same problem.


"result" array will contain the Contingent Array and "sum" will contain Max sum from the array.

Hope this will help you a lot.
Best of luck.

No comments:

Post a Comment