Right Side Equal to the Left

You are given an array of integers as an argument. Return true if there is a point in the array where the sum of the left hand side would be equal to the sum of the right hand side.

The argument array will always have an odd number of 3 or more elements.

Requirements

  • Must return true or false
  • Must account for negative integers

Example #1

solve([5,4,3,9])
> true

Using 3 as the breakpoint, 5 + 4 on the left would equal 9 on the right, so we return true.

Example #2

solve([5,1,3,9])
> false

Using 1 as the breakpoint. 3 + 9 on the right would not equal 5 on the left. Using 3 as the breakpoint 5 + 1 on the left would not equal 9 on the right, so we return false

Example #3

solve([5,5,-1,3,9])
> true

Using 3 as the breakpoint, 5 + 5 - 1 on the left would equal 9 on the right, so we return true