Computer Science, asked by errortcp, 1 month ago

possibilities where the sum on both the dice is equal to the output sum.If there are no possibilities return 0. ?

Sample Input:

10

Output:

3​

Answers

Answered by prajwal8577
0

Explanation:

The above solution exhibits overlapping subproblems. If we draw the solution’s recursion tree, we can see that the same subproblems are getting computed repeatedly. We know that problems with optimal substructure and overlapping subproblems can be solved using dynamic programming, in which subproblem solutions are memoized rather than computed again and again. The memoized version follows the top-down approach since we first break the problem into subproblems and then calculate and store values.

Similar questions