What is wrong with this approach ? (Minimum Money Needed )


None of the test cases are getting accepted.

@BloodyOssan
Read the question carefully. Number of inputs in second line is w not n. So change line 31 to for (int i = 1; i <=w; i++)
Your code will work

1 Like

this is sad :frowning:
lol
thanks btw !