Find all zones, the maximal groups of mutually reachable cities, in a directed graph.
connections[i] = [a, b] is a one-way connection from city a to city b. A zone is a maximal group of cities where for any two cities u and v in the zone there is a directed path from u to v and from v to u. Test case: connections = [(0,1),(1,2),(2,3),(3,0),(3,4),(4,5),(5,4),(6,5),(6,7)], n = 8 -> [[0,1,2,3],[4,5],[6],[7]]. Follow-up: a trapped zone has at least one incoming connection from another zone and no outgoing connections to any other zone; once entered, you can travel within it but cannot leave. Same input -> [[4,5],[7]].
A trapped zone is a zone that has at least one incoming connection from another zone and no outgoing connections to any other zone. Follow-up: find all the trapped zones. Follow-up test case: connections = [(0,1),(1,2),(2,3),(3,0),(3,4),(4,5),(5,4),(6,5),(6,7)] -> [[4, 5], [7]]
Expect follow-ups like
- Find all trapped zones: zones with at least one incoming connection from another zone and no outgoing connections to any other zone.


