finding subarray with given sum