Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than index2. Please note that your returned answers (both index1 and index2) are zero-based.
Solution #1 - Brute Force search. O(n) Space, O(n^2) time
Solution #2 - Double pointer. O(n) Space, O(nlogn)time
Solution #3 - Hash. O(n) Space, O(n)time