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 hints

Topics

Also asked at 6 companies


More Yandex Questions

View all Yandex questions