We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef6c8f1 commit f953133Copy full SHA for f953133
src/main/kotlin/g0401_0500/s0470_implement_rand10_using_rand7/Solution.kt
@@ -14,9 +14,9 @@ import java.util.Random
14
class Solution {
15
private val random: Random = Random()
16
fun rand10(): Int {
17
- var r1 : Int
+ var r1: Int
18
do {
19
- var r2 : Int
+ var r2: Int
20
do { r2 = rand7() } while (r2 == 7)
21
if (r2 in 1..3) { r1 = rand7() } else { r1 = 7 + rand7() }
22
} while (r1 > 10)
0 commit comments