Unfortunately those answers are only right for the example and the actual answer can be in the range [2,147,483,648..2,147,483,647]. But if that try catch loop works you may have a way to hack through many of the questions.
You need to find the array index where the sum of all the elements before it matches the sum of all the elements after it.
If A + A + A = A + A +A the answer is 3
Keep Up with TechRepublic