i have tried all test cases in forum and its giving write answer...can anybody provide me some test case where my code fails..
thanks...AGAIN...
10 2 6 5 5 4 0 0
dp really only needs to be dp[505]. Then you can find the amount and best fun in O(amt).