comefrom: <gouthampradhan>math_MinimumIndexSumOfTwoLists_1.java
code: public String[] findRestaurant(String[] list1, String[] list2) {
      Map<String, Integer> index = new HashMap<>();
      for (int i = 0; i < list2.length; i++) {
        String s = list2[i];
        index.put(s, i);
      }
      int min = Integer.MAX_VALUE;
      List<String> list = new ArrayList<>();
      for (int i = 0; i < list1.length; i++) {
        if (index.containsKey(list1[i])) {
          if (i + index.get(list1[i]) <= min) {
            min = i + index.get(list1[i]);
          }
        }
      }
      for (int i = 0; i < list1.length; i++) {
        if (index.containsKey(list1[i])) {
          if (i + index.get(list1[i]) == min) {
            list.add(list1[i]);
          }
        }
      }
      String[] ans = new String[list.size()];
      int i = 0;
      for (String s : list) {
        ans[i++] = s;
      }
      return ans;
    }
masked: public String [ ] var_0 ( String [ ] var_1 , String [ ] var_2 ) {
    Map < String , Integer > var_3 = new HashMap < > ( ) ;
    for ( int var_4 = 0 ;
    var_4 < var_2 . length ;
    var_4 ++ ) {
      String var_5 = var_2 [ var_4 ] ;
      var_3 . put ( var_5 , var_4 ) ;
    }
    int var_6 = Integer . MAX_VALUE ;
    List < String > var_7 = new ArrayList < > ( ) ;
    for ( int var_4 = 0 ;
    var_4 < var_1 . length ;
    var_4 ++ ) {
      if ( var_3 . containsKey ( var_1 [ var_4 ] ) ) {
        if ( var_4 + var_3 . get ( var_1 [ var_4 ] ) <= var_6 ) {
          var_6 = var_4 + var_3 . get ( var_1 [ var_4 ] ) ;
        }
      }
    }
    for ( int var_4 = 0 ;
    var_4 < var_1 . length ;
    var_4 ++ ) {
      if ( var_3 . containsKey ( var_1 [ var_4 ] ) ) {
        if ( var_4 + var_3 . get ( var_1 [ var_4 ] ) == var_6 ) {
          var_7 . add ( var_1 [ var_4 ] ) ;
        }
      }
    }
    String [ ] var_8 = new String [ var_7 . size ( ) ] ;
    int var_4 = 0 ;
    for ( String var_5 : var_7 ) {
      var_8 [ var_4 ++ ] = var_5 ;
    }
    return var_8 ;
  }
  