06 Feb PMCA Sunday 12:00 Java Homework 20.02.02.
Question:
Let’s say you have 4 coins each worth 1$, 2$ , 5$ and 10$. You have to find the number of ways you can give him N dollars change. N is a whole number.
Sample Input 1:
1
Sample Output 1:
1
Explanation:
You can give him only one 1$ coin
Sample Input 2:
2
Sample Output 2:
2
Explanation:
You can give him three 1$ coin or one 2$ coin
Sample Input 3:
3
Sample Output 3:
3
Explanation:
You can give three 1$ coin or one 1 $ coin one 2$ coin or three 1$ coin
Sorry, the comment form is closed at this time.