Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • Whats the difference between hashing and your solution ? Commented Dec 1, 2012 at 9:29
  • Nothing his is still O(N) space Commented Sep 23, 2013 at 21:31
  • 4
    OP explicitly said no extra space.. why is this answer upvoted? Commented Nov 16, 2013 at 0:57
  • try it with array=[ 1, 2, 10, 3, 4], and sum = 20 Commented May 29, 2015 at 4:48