id/email
password
forgot password | create account
about | help | prefs
ReadingBatcode reading practice

 

 

StringsFuncSum1

prev  |  next  |  chance

fun funcSum1(funcs: List<() -> Int>): Int =
    funcs.map { it() }.sum()

Function Call  Return Value
funcSum1(listOf({ 5 }, { 3 }))
funcSum1(listOf({ 8 }, { 6 }, { 11 }))
funcSum1(listOf({ 1 }, { 2 }, { 3 }, { 4 }))
funcSum1(listOf({ 9 }, { 9 }))

Experiment with this code on Gitpod.io or as a Kotlin Playground

⬅ Back