
All the nodes are zero-based.
Input:
N=5, M=5, edges=[(0, 1), (1, 4), (2, 3), (2, 4), (3, 4)], src=1
Output: 1 0 2 2 1

Explanation: The path from vertices are:-
(1->0) = 1 -> 0, path length is 1.
(1->1) = 1 -> 1, path length is 0.
(1->2) = 1 -> 4 -> 2, the path length is 2.
(1->3) = 1 -> 4 -> 3, path length is 2.
(1->4) = 1 -> 4, the path length is 1.
Hence we return [1, 0, 2, 2, 1]
The first line of the input will contain integers 'N' and 'M', denoting the number of nodes and the number of edges.
The next 'M' lines contain two space-separated integers, denoting an undirected edge between 'a' and 'b'.
The next line contains an integer denoting 'src'.
The only line contains 'N' space-separated integers, i.e., the path length to each node.
You don't need to print anything. Just implement the given function.
Algorithm:
Algorithm:
Algorithm: