Solved TwoSum problem from leetcode.com