import java.util.Hashtable;

public class Solution {
    public int[] twoSum(int[] nums, int target) {
        Hashtable<Integer, Integer> dict = new Hashtable<Integer, Integer>();
        int len = nums.length;
        int[] res = new int[2];
        for(int i=0; i<len; i++){
            if(dict.containsKey(target - nums[i])){
                res[0] = dict.get(target - nums[i])+1;
                res[1] = i+1;
                return res;
            }
            dict.put(nums[i], i);
        }
        
        return res;
    }
}

@@ -1,8 +1,34 @@
+/*%0A * @author: cchen%0A */%0A%0A
 import j

Update TwoSum_002.java