<qiyuangong>547_Friend_Circles_2.java
public int findCircleNum(int[][] M) {
        int[] visited = new int[M.length];
        int count = 0;
        Queue < Integer > queue = new LinkedList < > ();
        for (int i = 0; i < M.length; i++) {
            if (visited[i] == 0) {
                queue.add(i);
                while (!queue.isEmpty()) {
                    int s = queue.remove();
                    visited[s] = 1;
                    for (int j = 0; j < M.length; j++) {
                        if (M[s][j] == 1 && visited[j] == 0)
                            queue.add(j);
                    }
                }
                count++;
            }
        }
        return count;
    }
public int sample_funcname ( int [ ] [ ] var_0 ) {
  int [ ] var_2 = new int [ var_0 . length ] ;
  int var_4 = 0 ;
  Queue < Integer > var_8 = new LinkedList < > ( ) ;
  for ( int var_9 = 0 ;
  var_9 < var_0 . length ;
  var_9 ++ ) {
    if ( var_2 [ var_9 ] == 0 ) {
      var_8 . add ( var_9 ) ;
      while ( ! var_8 . isEmpty ( ) ) {
        int var_13 = var_8 . remove ( ) ;
        var_2 [ var_13 ] = 1 ;
        for ( int var_15 = 0 ;
        var_15 < var_0 . length ;
        var_15 ++ ) {
          if ( var_0 [ var_13 ] [ var_15 ] == 1 && var_2 [ var_15 ] == 0 ) var_8 . add ( var_15 ) ;
        }
      }
      var_4 ++ ;
    }
  }
  return var_4 ;
}
