Ad
Code
Diff
  • fun fact(n: Int): Int = if (n == 0) 1 else fact(n-1) * n
    • fun fact(n: Int): Int {
    • if (n == 0) {
    • return 1
    • }
    • return fact(n-1) * n
    • }
    • fun fact(n: Int): Int = if (n == 0) 1 else fact(n-1) * n