Why is this code not working and the code below is properly working?
Problem: -
http://codeforces.com/problemset/problem/160/A
Why is this code not working and the code below is properly working?
hi @cbcao263 the question is asking for minimum number of coins needed, and if you add larger numbers( ie if you start from the back of a sorted array) you will need less numbers, whereas if you add smaller numbers (ie if you start from front of a sorted array) you will need more numbers.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.