public int[] findOrder(int numCourses, int[][] prerequisites) {
        adjList = new ArrayList<>(numCourses);
        for (int i = 0; i < numCourses; ++i) {
            adjList.add(new ArrayList<>());
        }
        int[] incoming = new int[numCourses];
        for (int i = 0; i < prerequisites.length; ++i) {
            // link u -> v
            int u = prerequisites[i][1], v = prerequisites[i][0];
            adjList.get(u).add(v);
            incoming[v] += 1;
        }
        return bfs(incoming, numCourses);
    }