Sponsored
Use these hints if you're stuck. Try solving on your own first.
How can BFS be used?
For each vertex u, calculate the length of the shortest cycle that contains vertex u using BFS
Solve with full IDE support and test cases