comefrom: <awangdev>Bus Routes_1.java
code: public int numBusesToDestination(int[][] routes, int S, int T) {
          Set<Integer> visited = new HashSet<>();
          Map<Integer, Set<Integer>> stopMap = new HashMap<>();
          Queue<Integer> queue = new LinkedList<>();
          for (int i = 0; i < routes.length; i++) {
              for (int stop : routes[i]) {
                  stopMap.putIfAbsent(stop, new HashSet<>());
                  stopMap.get(stop).add(i); 
              }
          }
          queue.offer(S);
          int count = 0;
          while (!queue.isEmpty()) {
              int size = queue.size();
              for (int i = 0; i < size; i++) { 
                  int stop = queue.poll(); 
                  if (stop == T) return count;
                  for (int bus : stopMap.get(stop)) {
                      if (!visited.contains(bus)) {
                          visited.add(bus);
                          for (int nextStop : routes[bus]) {
                              queue.offer(nextStop); 
                          }
                      }
                  }
              }
              count++;
          }
          
          return -1;
      }
masked: public int sample_funcname ( int [ ] [ ] var_0 , int var_1 , int var_2 ) {
    Set < Integer > var_3 = new HashSet < > ( ) ;
    Map < Integer , Set < Integer >> var_4 = new HashMap < > ( ) ;
    Queue < Integer > var_5 = new LinkedList < > ( ) ;
    for ( int var_6 = 0 ;
    var_6 < var_0 . length ;
    var_6 ++ ) {
      for ( int var_7 : var_0 [ var_6 ] ) {
        var_4 . putIfAbsent ( var_7 , new HashSet < > ( ) ) ;
        var_4 . get ( var_7 ) . add ( var_6 ) ;
      }
    }
    var_5 . offer ( var_1 ) ;
    int var_8 = 0 ;
    while ( ! var_5 . isEmpty ( ) ) {
      int size = var_5 . size ( ) ;
      for ( int var_6 = 0 ;
      var_6 < size ;
      var_6 ++ ) {
        int var_7 = var_5 . poll ( ) ;
        if ( var_7 == var_2 ) return var_8 ;
        for ( int var_9 : var_4 . get ( var_7 ) ) {
          if ( ! var_3 . contains ( var_9 ) ) {
            var_3 . add ( var_9 ) ;
            for ( int var_10 : var_0 [ var_9 ] ) {
              var_5 . offer ( var_10 ) ;
            }
          }
        }
      }
      var_8 ++ ;
    }
    return - 1 ;
  }
  