The change-making problem is to find the minimum number of bills and coins that total to a given sum of money.
3
votes
3answers
134 views
A program to represent a coin amount using the smallest number of coins
Recently, I was learning about greedy algorithms. One example that was given was an algorithm for exchanging a given money amount using the smallest number of coins. After the lecture, I wrote a C ...
5
votes
3answers
1k views
Give me some change as asked in interview
Description:
The goal in this problem is to find the minimum number of coins needed
to change the input value (an integer) into coins with denominations 1,
5, and 10
The input consists of ...
4
votes
0answers
91 views
Coin change algorithm
I've implemented the coin change algorithm using Dynamic Programming and Greedy Algorithm w/ backtracking. The description is as follows:
Given an amount of change (n) list all of the possibilities ...
3
votes
2answers
119 views
Change-making problem with specific constraints
I am a new Pythoner. I have solved a OJ project with Python. Can you tell me how can I solve it more Pythonically?
Problem Description: There are n coin denominations, each with an unlimited ...
5
votes
1answer
146 views
Given a monetary amount, calculate the equivalent change
I have written a program that takes in some amount of money, and prints the equivalent change (starting at hundred dollars, to fifty, to twenty, down the pennies). Here is the code:
...
4
votes
2answers
136 views
Bills dispenser machine
I have just started out learning C++ and I am trying to write out a simple bills' dispenser machine as an exercise.
Upon user input, the system is to check if it can pay out the amount but only in 20 ...
3
votes
2answers
382 views
Converting money into change
I am trying to figure out a more efficient way of converting money into change. The code below is what i have written so far. It works perfectly but i know the code can be improved. Is there a more ...
3
votes
1answer
44 views
Calculating change in Ada
I have written a change calculator using Ada. when the user inputs an amount of money it returns a list of the coins and bills needed to create that total. It starts off by trying to use the largest ...
10
votes
3answers
1k views
Coin Change: Minimum number of coins
Problem:
You are given n types of coin denominations of values \$v(1) < v(2) < ... < v(n)\$ (all integers). Assume \$v(1) = 1\$, so you can always make change for any amount of money \$C\$....
14
votes
5answers
10k views
Find Minimum Number of coins
Please be brutal, and treat this as a top 5 technical interview. I am trying to follow Google's way of writing Java code, as per their .pdf file online of code review. (Side note: do any of you see ...
3
votes
1answer
1k views
More optimal “Making Change” Problem: Knapsack challenge
The problem description is:
You are given n types of coin denominations of values v(1) < v(2) <
... < v(n) (all integers). Assume v(1) = 1, so you can always make
change for any ...