<awangdev>1213. Intersection of Three Sorted Arrays_2.java
public List<Integer> arraysIntersection(int[] arr1, int[] arr2, int[] arr3) {
        List<Integer> rst = new LinkedList<>();
        int i = arr1.length - 1, j = arr2.length - 1, k = arr3.length - 1;
        
        while (i >= 0 && j >= 0 && k >= 0) {
            if (arr1[i] == arr2[j] && arr2[j] == arr3[k]) {
                if (rst.isEmpty() || arr1[i] != rst.get(rst.size() - 1)) rst.add(0, arr1[i]);
                i--;
                j--;
                k--;
            } else if (arr2[j] < arr3[k]) k--; 
            else if (arr1[i] < arr2[j]) j--;
            else i--;
        }
        
        return rst;
    }
public List < Integer > var_1 ( int [ ] var_2 , int [ ] var_3 , int [ ] var_4 ) {
  List < Integer > var_7 = new LinkedList < > ( ) ;
  int var_10 = var_2 . length - 1 , var_11 = var_3 . length - 1 , var_12 = var_4 . length - 1 ;
  while ( var_10 >= 0 && var_11 >= 0 && var_12 >= 0 ) {
    if ( var_2 [ var_10 ] == var_3 [ var_11 ] && var_3 [ var_11 ] == var_4 [ var_12 ] ) {
      if ( var_7 . isEmpty ( ) || var_2 [ var_10 ] != var_7 . get ( var_7 . size ( ) - 1 ) ) var_7 . add ( 0 , var_2 [ var_10 ] ) ;
      var_10 -- ;
      var_11 -- ;
      var_12 -- ;
    }
    else if ( var_3 [ var_11 ] < var_4 [ var_12 ] ) var_12 -- ;
    else if ( var_2 [ var_10 ] < var_3 [ var_11 ] ) var_11 -- ;
    else var_10 -- ;
  }
  return var_7 ;
}
