Problem

Given arr, sum elements from index 0 until you hit 0 (exclusive of 0 and after).

Examples

  • sumUntilZero([1, 2, 0, 9]) -> 3
  • sumUntilZero([5]) -> 5
Compile and test (Ctrl+Enter)