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 <srinivaseev...@gmail.com>wrote: > sorry man to say that in your example so many solutions exist and one more > thing is problem is not clear try to give clear idea > > > On Tue, Aug 17, 2010 at 11:47 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 MaxSum >> int[] FindMaxSumArray(int[] array, int maxsum) >> for example, given array: {1, -2, 4, 5, -2, 6, 7} >> maxsum=7 >> the result would be: {1,-2, -2, 6} >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algoge...@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> >> . >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algoge...@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Amit Jaspal Btech IT IIIT- Allahabad -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.