Calculating something recursive once again.

Report a typo

Given function F, what would it return if called as f(6)?

fun f(n: Int): Int = if (n > 2) f(n - 1) + f(n - 2) + f(n - 3) else n


Enter a number
___

Create a free account to access the full topic