Leetcode 1155. Number of Dice Rolls With Target Sum
Count the number of length-n sequences of values 1..k whose sum equals target, returning the count modulo 1e9+7. This is a classic DP/counting problem (bounded compositions) usually solved by dynamic programming over number of dice and current sum (constraints: n,k ≤ 30, target ≤ 1000).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.