TwoSum with extra 2n memory elements , O(n) memory and O(n lg n) time