Check if subarray with 0 sum is exists or not

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.

Example Solution

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.

Contributed by Murat Sütunç