1155. Number of Dice Rolls With Target Sum
Description
**Input:** d = 1, f = 6, target = 3
**Output:** 1
**Explanation:**
You throw one die with 6 faces. There is only one way to get a sum of 3.**Input:** d = 2, f = 6, target = 7
**Output:** 6
**Explanation:**
You throw two dice, each with 6 faces. There are 6 ways to get a sum of 7:
1+6, 2+5, 3+4, 4+3, 5+2, 6+1.**Input:** d = 2, f = 5, target = 10
**Output:** 1
**Explanation:**
You throw two dice, each with 5 faces. There is only one way to get a sum of 10: 5+5.ac
Last updated