what is wrong with this code? why does it return a...
# announcements
d
what is wrong with this code? why does it return a negative value (if I use a lower number like
20
it seems to work, but a number like
100
will also cause a large negative value )
println(fibonacci(50).last())
fun fibonacci() = generateSequence(Pair(0, 1), { Pair(it.second, it.first + it.second) }).map { it.first }
fun fibonacci(n: Int): Sequence<Int> = fibonacci().take(n)
m
mishaxz: Not Krelated, goto:stackoverflow Use
BigInteger
.