LearnPy Hub
← Arena
AdvancedRating 1600

Coin Change Ways

Count how many ways you can make the target amount using unlimited coins of the given values. Order doesn't matter.

Input

First line n and target, second line n coin values.

Output

The number of ways.

Sample 1

Input
3 4
1 2 3
Output
4

Sample 2

Input
4 10
2 5 3 6
Output
5
solution.py
Output appears here
Coin Change Ways · Python Arena problem · LearnPy Hub