in reply to Re: LeetCode Problem #1 - Two Sum - Improve and/or discuss.
in thread LeetCode Problem #1 - Two Sum - Improve and/or discuss.

As already pointed out by kcott is the uniqueness of the solution guarantied. --> Re^8: LeetCode Problem #1 - Two Sum - Improve and/or discuss.

Hence no need for greping.

If the first occurrence was really required, I'd rather store it in the hash.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

  • Comment on Re^2: LeetCode Problem #1 - Two Sum - Improve and/or discuss.