public static int[] twoSum(int[] numbers, int target) {//AC
        if (numbers == null || numbers.length < 2) return null;
        HashMap<Integer, Integer> hm = new HashMap<Integer, Integer>();
        int ret[] = {0, 0};
        for (int i = 0; i < numbers.length; ++i) {
            if (!hm.containsKey(target - numbers[i])) {
                hm.put(numbers[i], i);
            }
            else {
                int tmp1 = hm.get(target - numbers[i]) + 1;
                int tmp2 = i + 1;

                if (tmp1 < tmp2) {
                    ret[0] = tmp1;
                    ret[1] = tmp2;
                }
                else {
                    ret[0] = tmp2;
                    ret[1] = tmp1;
                }
                return ret;
            }
        }
        return ret;
    }