Problem

Return true if the array can be split into two consecutive non-empty parts with equal sums.

Examples

  • canSplitEqualSum([2, 2, 4]) -> true
  • canSplitEqualSum([1, 2, 3, 4]) -> false
  • canSplitEqualSum([4, 4, 4, 4]) -> true
Compile and test (Ctrl+Enter)