1 to 6, with one restriction: face i can never come up more than max_streak[i − 1] times in a row.
How many different sequences of exactly rolls throws can this die produce? Two sequences differ if they hold different numbers in at least one position.
The answer can be large, so return it modulo 10⁹ + 7.rolls=2, max_streak=[2, 2, 2, 1, 2, 1] → 34
Without limits there are 36 pairs. Only 4, 4 and 6, 6 are banned, since those faces cannot come up twice in a row. That leaves 34.
rolls=3, max_streak=[1, 1, 1, 1, 1, 1] → 150
Each throw must differ from the one before it: 6 · 5 · 5 = 150.
rolls=2, max_streak=[2, 2, 2, 1, 2, 1]
34
Run checks the first 3 tests in your browser. Submit checks all 43 tests on the server, hidden ones included.