Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use the breadth-first search to go through all nodes layer by layer.
Solve with full IDE support and test cases