Not added in as a Leetcode problem but for sure was used by some company before

https://discuss.leetcode.com/topic/59889/dice-roll/3

http://www.mathpages.com/home/kmath093/kmath093.htm

When n dices with m faces are rolled together, find the number of ways the sum of the faces is X.

second link above showed a way to reduce the loops from 3 to 2!

Comments

Popular posts from this blog

Completed the LeetCode #2 adding two numbers