Your question is Shortest Paths in Unweighted Graph. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given an unweighted graph with n nodes labeled from 0 to n - 1, an edge list edges, and a source node src, return an array dist where dist[i] is the length of the shortest path from src to node i. If a node is unreachable, return -1 for that node. The graph is undirected.
def shortest_paths_unweighted(n, edges, src):