Ad
Code
Diff
  • val f={i:Int->i}
    • val returnInt = { i: Int -> i }
    • val f={i:Int->i}
Code
Diff
  • val returnInt = { i: Int -> i }
    • fun Int.returnInt() = this
    • val returnInt = { i: Int -> i }
Code
Diff
  • fun sum(array: IntArray) = array.reduce { sum, element -> sum + element }
    • def sum(arr):
    • result = 0
    • for i in arr:
    • result += i
    • return result
    • fun sum(array: IntArray) = array.reduce { sum, element -> sum + element }