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