Given an array of integers, check if the array contains a sub-array such that, when you add all the array members the summation is equal to zero.
Let array arr
equal to [ 3, 4, -7, 3, 1, 3, 1, -4, -2, -2 ]
, the sub-arrays with 0 sum are:
[ 3, 4, -7 ]
[ 4, -7, 3 ]
[ -7, 3, 1, 3 ]
[ 3, 1, -4 ]
[ 3, 1, 3, 1, -4, -2, -2 ]
[ 3, 4, -7, 3, 1, 3, 1, -4, -2, -2 ]
The function should return the value true
in this case.