Skip to content

Latest commit

 

History

History
executable file
·
24 lines (11 loc) · 583 Bytes

Number_Of_Ways_To_Make_Change.md

File metadata and controls

executable file
·
24 lines (11 loc) · 583 Bytes

Number Of Ways To Make Change

Problem Statement

Given an array of positive integers representing coin denominations and a single non-negative integer representing a target amount of money, implement a function that returns the number of ways to make change for that target amount using the given coin denominations. Note that an unlimited amount of coins is at your disposal.

Sample input: 6, [1, 5]

Sample output: 2 (1x1 + 1x5 and 6x1)

Explanation

We can use a Stack here

Solution

Check this Python code.