Tag Archive | array

Sub-array with sum zero

Ques: An array contains negative as well as positive numbers in random order, find the first sub array for which the sum of all the elements is zero. Solution: First of all we need to think how can we find out if the sum of all the elements in a sub array is zero. Let’s […]