Given a array of positive integers ,You have to find the largest sum
possible from consecutive sub-array but sum should be less than or equal to
K and also find that sub-array. Ex- array={2,1,3,4,5} k=12,
ans->12, sub-array={3,4,5}
Firstly i tried with brute-force and then i also tried to solve it by DP
but complexity were same ( O(n^2)) ....so plz try to provide a solution for
O(nlgn) or O(n).
--
Mohit kumar lal
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.