CT048

Combination Lock Coin Ways

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The toy shop accepts an unlimited supply of each coin denomination. Count distinct combinations for the price; ordering coins differently is not a new combination. Task: Count combinations to make A using unlimited coins, modulo 1,000,000,007. Input format: n A; then n distinct positive coin values. Output format: Print combination count modulo 1,000,000,007. Constraints: 1 <= n <= 100; 0 <= A <= 100000; 1 <= coin <= 100000

Example 1:

Input: 3 5 1 2 5
Output: 4

Example 2:

Input: 1 0 3
Output: 1

Example 3:

Input: 2 3 2 4
Output: 0

Constraints:

1 <= n <= 100; 0 <= A <= 100000; 1 <= coin <= 100000

Tags:

dynamic-programming coin-change counting
Loading...
Test Cases:No test cases
No test cases available.
Combination Lock Coin Ways - MEDIUM Coding Problem | CodeTikki