[algogeeks] Re: Longest SubSequence with Sum K

2010-08-31 Thread Jinsong Huang
Amit, Could you explain why {1, -2, 4, 5, -2} is not a solution, the sum is 6 and it's longer than {1, -2, -2, 6}. Thanks. Jinsong On Aug 17, 2:17 pm, amit amitjaspal...@gmail.com wrote: Given an array, find the longest subarray which the sum of the subarray less or equal then the given

[algogeeks] Re: Longest SubSequence with Sum K

2010-08-28 Thread rahul patil
Is it required that sub array must be continuous. On Aug 18, 12:34 pm, Amit Jaspal amitjaspal...@gmail.com wrote: You have to return the length of the subsequence with longest length and sum K . If there are multiple solutions report anyone. On Wed, Aug 18, 2010 at 12:40 PM, srinivas reddy