@@ -0,0 +1,638 @@
+package lc001_twosum;%0A%0Aimport java.util.HashMap;%0A%0Apublic class Solution %7B%0A    public int%5B%5D twoSum(int%5B%5D nums, int target) %7B%0A        int%5B%5D error = new int%5B%5D %7B-1, -1%7D;%0A        if (nums.length %3C 2) %7B%0A            return error;%0A        %7D%0A%0A        HashMap%3CInteger,Integer%3E map = new HashMap%3CInteger,Integer%3E();%0A        for (int i = 0; i %3C nums.length; i++) %7B%0A            map.put(nums%5Bi%5D, i);%0A        %7D%0A%0A        Integer j;%0A        for (int i = 0; i %3C nums.length; i++) %7B%0A            j = map.get(target - nums%5Bi%5D);%0A            if (j != null) %7B%0A                return new int%5B%5D %7Bi + 1, j + 1%7D;%0A            %7D%0A        %7D%0A        return error;%0A    %7D%0A%7D

leetcode-1 add two sum