Search
⌘K
Get Premium
Leetcode 1223. Dice Roll Simulation
Count the number of length-n sequences of 6-sided die rolls where face i cannot appear more than rollMax[i] consecutive times, returning the result modulo 1e9+7; with n up to 5000 and rollMax[i] ≤ 15 this requires dynamic programming over positions and run-lengths rather than brute force.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.