<awangdev>15. 3Sum_2.java
public ArrayList<ArrayList<Integer>> calTwoSum(int[] num, int end, int target) {
        ArrayList<ArrayList<Integer>> rst = new ArrayList<ArrayList<Integer>>();
        ArrayList<Integer> match;
        HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
        for (int i = 0; i <= end; i++) {
            if (map.containsKey(num[i])) {
                match = new ArrayList<Integer>();
                match.add(num[map.get(num[i])]);
                match.add(num[i]);
                if (!rst.contains(match)) {
                    rst.add(new ArrayList<Integer>(match));
                }
            } else {
                map.put(target - num[i], i);
            }
            if (i < end && num[i] == num[i + 1]) {
                continue;
            }
        } 
        return rst;
    }
public ArrayList < ArrayList < Integer >> var_2 ( int [ ] var_3 , int var_4 , int var_5 ) {
  ArrayList < ArrayList < Integer >> var_6 = new ArrayList < ArrayList < Integer >> ( ) ;
  ArrayList < Integer > var_7 ;
  HashMap < Integer , Integer > var_9 = new HashMap < Integer , Integer > ( ) ;
  for ( int var_11 = 0 ;
  var_11 <= var_4 ;
  var_11 ++ ) {
    if ( var_9 . containsKey ( var_3 [ var_11 ] ) ) {
      var_7 = new ArrayList < Integer > ( ) ;
      var_7 . add ( var_3 [ var_9 . get ( var_3 [ var_11 ] ) ] ) ;
      var_7 . add ( var_3 [ var_11 ] ) ;
      if ( ! var_6 . contains ( var_7 ) ) {
        var_6 . add ( new ArrayList < Integer > ( var_7 ) ) ;
      }
    }
    else {
      var_9 . put ( var_5 - var_3 [ var_11 ] , var_11 ) ;
    }
    if ( var_11 < var_4 && var_3 [ var_11 ] == var_3 [ var_11 + 1 ] ) {
      continue ;
    }
  }
  return var_6 ;
}
