Skip to content
ayvoren

Learn · Code

Write it, run it, see if it is right

16 challenges in Kotlin, Java, TypeScript, JavaScript, Python. Write the function, run it, and each test tells you what it expected and what it got.

Sum a list

Beginner

Return the sum of all the numbers. An empty list sums to 0.

  • sumList([1, 2, 3]) → 6
  • sumList([]) → 0
⌘/Ctrl + ↵ runs · saved as you type

Running sends this code to the Kotlin Playground (JetBrains), a free outside service, to compile and run it. Only the code is sent. Do not paste passwords or keys.