Leetcode practice of the random
topic.
Leetcode 470. Implement Rand10() Using Rand7()
Given a function rand7
which generates a uniform random integer in the range 1 to 7, write a function rand10
which generates a uniform random integer in the range 1 to 10.
Do NOT use system’s Math.random()
.
1 | # The rand7() API is already defined for you. |