Given an integer array, find a subarray where the sum of numbers is zero. Your code should return the index of the first number and the index of the last number.
There is at least one subarray that it's sum equals to zero.
Example
Given[-3, 1, 2, -3, 4], return[0, 2]or[1, 3].
[-3, 1, 2, -3, 4]
[0, 2]
[1, 3]
Last updated 6 years ago