Implement Rand10() Using Rand7() at Bloomberg
Medium46.2% acceptance
This problem has 12.5% frequency at Bloomberg.
Problem Description
Given the **API** `rand7()` that generates a uniform random integer in the range `[1, 7]`, write a function `rand10()` that generates a uniform random integer in the range `[1, 10]`. You can only call the API `rand7()`, and you shouldn't call any other API. Please **do not** use a language's built-i...
Read full problem and hintsTopics
Also asked at 6 companies
More Bloomberg Questions
Add Two NumbersMediumInsert Delete GetRandom O(1)MediumReverse IntegerMediumPalindrome NumberEasyRoman to IntegerEasy
View all Bloomberg questions