int sum=0,ans=0,l=0,r=0; //sum will store curr_sum,l will point to left boundary and r will point ot right boundary,ans will store length of longest segment. Subarray starting with 4: 4 2 1 is a ...
// Given an unsorted array arr of size n that contains only non negative integers, find a sub-array (continuous elements) that has sum equal to s. You mainly need to return the left and right ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results