Login

All Problems

Problem title

Difficulty

Avg time to solve

Ninja And Candies

Moderate

15 mins

Number of rectangles in a grid

Easy

15 mins

Common Elements In Three Sorted Arrays

Moderate

35 mins

K-th Largest Sum Subarray

Easy

10 mins

Goku and Dragon Balls

Moderate

35 mins

Covid Spread

Hard

45 mins

The N - Queens Puzzle

Moderate

--

0 1 Knapsack

Moderate

--

Insertion Sort

Easy

--

Ways To Make Coin Change

Moderate

20 mins

Problem

Submissions

7

Avg. time to solve

20 min

Success Rate

80%

Problem Statement

```
The first line of input contains an integer N, representing the total number of denominations.
The second line of input contains N integers values separated by a single space. Each integer value represents the denomination value.
The third line of input contains the value of V, representing the value for which the change needs to be generated.
```

```
For each test case, print an integer denoting the total number of ways W, in which a change for V is possible.
```

```
You do not need to print anything, it has already been taken care of. Just implement the given function.
```

```
1 <= N <= 10
1 <= D[i] <=10^5
1 <= V <= 2 * 10^3
Where 'D[i]' represent the value of ith denomination.
Time Limit: 1sec
```

```
3
1 2 3
4
```

```
4
```

```
We can make a change for the value V = 4 in four ways.
1. (1,1,1,1),
2. (1,1, 2), [One thing to note here is, (1, 1, 2) is same as that of (2, 1, 1) and (1, 2, 1)]
3. (1, 3), and
4. (2, 2)
```

```
3
5 3 2
1
```

```
0
```

Console

Sample Test Case

Custom Test Case

Download Test Cases

Test Case 1

Test Case 2

Test Case 3

Saving Code...

Full Screen Mode

Change Language

Change Theme

Solution submission not allowed

Save Code

Reset Code