1155. Number of Dice Rolls With Target Sum
https://leetcode.com/problems/number-of-dice-rolls-with-target-sum
Description
You have d
dice and each die has f
faces numbered 1, 2, ..., f
. You are given three integers d
, f
, and target
.
Return the number of possible ways (out of fd
total ways) modulo 109 + 7
to roll the dice so the sum of the face-up numbers equals target
.
Example 1:
Example 2:
Example 3:
Example 4:
Example 5:
Constraints:
1 <= d, f <= 30
1 <= target <= 1000
ac
Last updated