How can we change the same function to print or get the coins along with the minimum numbers of coins that are needed?
For example: coins[] = {1, 7, 10}, and we want to make 15 ruppes. We need 3 coins
But what to do when we have to print those coins.
O/P is 7, 7, 1 or 1, 7, 7 anything
Print the Min Coins in Coin Change problem : DP
Hello @Kishan-Mishra-2464674013761441,
While you are incrementing the count variable,
simply print the value for which the count has been incremented.
Or, the value returned by the lower_bound function.
Share the code and i’ll modify it if you are facing issue.
Hope, this would help.
Give a like if you are satisfied.
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.