Easy · Math
Random Number
Given integers minVal and maxVal in [−10⁹, 10⁹] (in either order) and a signed 64-bit seed, return an integer chosen uniformly at random from their inclusive range using a generator seeded with seed, so the same inputs always give the same result.
Examples
Example 1
[3, 8] seed 7Output: pick = 5
Example 2
[10, 4] seed 42Output: pick = 9
Rebuild it in the studio
Core interview problems are free with a full runner and lessons; Pro opens the complete library.