LeetCode 470 - Implement Rand10() Using Rand7()
LeetCode Problem 470 Difficulty: 🟡 Medium Topics: Math, Rejection Sampling, Randomized, Probability and Statistics Solution Problem Understanding The problem provides access to a single API, rand7() , which returns a uniformly random integer from 1 to 7 . The task is to implement another function, rand10() , which must return a uniformly random integer from 1 to 10 . The important constraint is that we are not allowed to use...