mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-16 08:31:35 +00:00
11 lines
160 B
Kotlin
11 lines
160 B
Kotlin
tailRecursive fun foo(x: Int) {
|
|
return if (x > 0) {
|
|
(foo(x - 1))
|
|
}
|
|
else Unit.VALUE
|
|
}
|
|
|
|
fun box(): String {
|
|
foo(1000000)
|
|
return "OK"
|
|
} |