Breadth First Search: Shortest Reach
- Time : O(v + e)
- Space : O(v + e)
c++
1 | vector<int> bfs(int n, int m, vector<vector<int>> edges, int s) { |