There are n rooms labeled 0 to n - 1. All rooms start locked except room 0. Each room holds a set of distinct keys to other rooms. Return true if you can enter every room, or false otherwise.
"This is reachability in a directed graph. Nodes are rooms 0..n-1, and keys inside room $u$ are directed edges $u \to v$."
"Do not confuse this with undirected connected components! Having key 2 in room 1 lets us enter room 2, but does not allow returning to room 1 unless room 2 has key 1."
"We run a standard DFS or BFS seeded at room 0. Maintain a boolean visited[n] array and a counter unlockedCount. Whenever we unlock a room, iterate through its keys and push unvisited rooms."
"Time complexity is $O(V + E)$ where $V = n$ and $E$ is total keys across all rooms. Space complexity is $O(V)$ for the visited array and recursion/queue stack."