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_2 , String [ ] var_3 ) {
    Map < String , Integer > var_7 = new HashMap < > ( ) ;
    for ( int var_9 = 0 ;
    var_9 < var_3 . length ;
    var_9 ++ ) {
      String var_11 = var_3 [ var_9 ] ;
      var_7 . put ( var_11 , var_9 ) ;
    }
    int var_14 = Integer . MAX_VALUE ;
    List < String > var_17 = new ArrayList < > ( ) ;
    for ( int var_9 = 0 ;
    var_9 < var_2 . length ;
    var_9 ++ ) {
      if ( var_7 . containsKey ( var_2 [ var_9 ] ) ) {
        if ( var_9 + var_7 . get ( var_2 [ var_9 ] ) <= var_14 ) {
          var_14 = var_9 + var_7 . get ( var_2 [ var_9 ] ) ;
        }
      }
    }
    for ( int var_9 = 0 ;
    var_9 < var_2 . length ;
    var_9 ++ ) {
      if ( var_7 . containsKey ( var_2 [ var_9 ] ) ) {
        if ( var_9 + var_7 . get ( var_2 [ var_9 ] ) == var_14 ) {
          var_17 . add ( var_2 [ var_9 ] ) ;
        }
      }
    }
    String [ ] var_22 = new String [ var_17 . size ( ) ] ;
    int var_9 = 0 ;
    for ( String var_11 : var_17 ) {
      var_22 [ var_9 ++ ] = var_11 ;
    }
    return var_22 ;
  }
  