public int[] importsCount(String[] requires){
        n = requires.length;
        graph = new boolean[n][n];
        visited = new boolean[n];

        graph = new boolean[n][n];
        for(int i=0; i<n; i++){
            for(int j=0; j<n; j++){
                if(requires[i].charAt(j)=='Y') graph[i][j] = true;
            }
        }
        for(int i=0; i<n; i++){
            Arrays.fill(visited,false);
            dfs(i, i);
        }
        int[] result = new int[n];
        for(int i=0; i<n; i++){
            int count = 0;
            for(int j=0; j<n; j++){
                if(graph[i][j]) count++;
            }
            result[i] = count;
        }
        return result;
    }