mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 15:53:37 +00:00
12 lines
155 B
Kotlin
12 lines
155 B
Kotlin
tailRecursive fun foo(x: Int) {
|
|
return if (x > 0) {
|
|
(foo(x - 1))
|
|
}
|
|
else Unit
|
|
}
|
|
|
|
fun box(): String {
|
|
foo(1000000)
|
|
return "OK"
|
|
}
|