Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use Tarjan's algorithm.
Solve with full IDE support and test cases