Get Rand10 from Rand7
https://www.lintcode.com/problem/implement-rand10-using-rand7/description

class Solution(SolBase):
def rand10(self):
while True:
rand48 = self.rand7()-1 + (self.rand7()-1)*7
if rand48 <= 39:
return rand48 // 4 + 1Last updated