<awangdev>349. Intersection of Two Arrays_1.java
public int[] intersection(int[] nums1, int[] nums2) {
        Set<Integer> set = new HashSet<>();
        for (int num : nums1) set.add(num);
        Set<Integer> rst = new HashSet<>();
        for (int num: nums2) {
            if (set.contains(num)) rst.add(num);
        }
        int i = 0;
        int[] result = new int[rst.size()];
        for (int num : rst) result[i++] = num;
        return result;
    }
public int [ ] sample_funcname ( int [ ] var_0 , int [ ] var_1 ) {
  Set < Integer > var_5 = new HashSet < > ( ) ;
  for ( int var_6 : var_0 ) var_5 . add ( var_6 ) ;
  Set < Integer > var_8 = new HashSet < > ( ) ;
  for ( int var_6 : var_1 ) {
    if ( var_5 . contains ( var_6 ) ) var_8 . add ( var_6 ) ;
  }
  int var_11 = 0 ;
  int [ ] var_13 = new int [ var_8 . size ( ) ] ;
  for ( int var_6 : var_8 ) var_13 [ var_11 ++ ] = var_6 ;
  return var_13 ;
}
