In my solution, the line which reads:

if (sum < result) sum = result;

Should read

if (sum < result) result = sum;

Don

On Friday, May 16, 2014 11:51:52 PM UTC-4, Shashwat Anand wrote:
>
> @Don 
> int coins [] = {1, 3, 5}; 
> int cnt [] = {7, 3, 1}; 
> int S = 9; 
> Your code returns 9, for the aforementioned test case.  Should not it 
> return 3 ? 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].

Reply via email to