Largest Continuous Sequence Zero Sum

Find the largest continuous sequence in a array which sums to zero.

Example:


Input:  {1 ,2 ,-2 ,4 ,-4}
Output: {2 ,-2 ,4 ,-4}

NOTE : If there are multiple correct answers, return the sequence which occurs first in the array.

NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.
Start solving Largest Continuous Sequence Zero Sum on Interview Code Editor
Sign Up
to access hints and editorial solutions for Largest Continuous Sequence Zero Sum
4062 successful submissions.
Asked In:
  • Microsoft
Click here to start solving coding interview questions