Solved TwoSum in java