I saw the merge sort based solution. For the problem find if a subarray with sum X exists in an array we can use hashmaps. Is it possible to solve this problem with a similar approach?
To the downvoter, turns out we can use a Map based solution. Refer https://discuss.leetcode.com/topic/54668/share-my-java-solution-using-treemap