Implement Rand10() Using Rand7() at Yandex
Medium46.2% acceptance
This problem has 25.0% frequency at Yandex.
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 Yandex Questions
Insert Delete GetRandom O(1)MediumAdd Two NumbersMediumPerfect SquaresMediumBasic Calculator IIMediumReverse IntegerMedium
View all Yandex questions