Challenge: Implement Breadth-First Search

Try to solve the Breadth-First Search problem.

We'll cover the following


Given a directed graph represented as an adjacency list, graph, and an integer, source, which is the starting vertex number, return an array of integers, result, that contains the order of the graph’s breadth-first traversal starting from the source vertex.


  • 11 \leqgraph.length \leq10310^3

  • 1000-1000 \leqgraph[i][j] \leq10001000


Level up your interview prep. Join Educative to access 70+ hands-on prep courses.