Challenge: A Subarray with a Sum of 0

Try to solve the A Subarray with a Sum of 0 problem.

We'll cover the following


Given a list containing both positive and negative integers, determine if there exists a sublist of consecutive elements whose elements sum to zero. Return TRUE if such a sublist exists; otherwise, return FALSE.


  • 11 \leq arr.length 103\leq 10^{3}
  • 10310^{-3} \leq arr[i] 103\leq 10^{3}


Level up your interview prep. Join Educative to access 80+ hands-on prep courses.