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 hints

Topics

Also asked at 6 companies


More Bloomberg Questions

View all Bloomberg questions