Unlock every room
There are n rooms numbered 0 to n - 1, and only room 0 starts unlocked. Inside room i you find the keys listed in keys[i]; each key is the number of the room it opens. Keys never wear out and you can carry as many as you like. Return True if you can get into every room, otherwise False.
keys has n ≥ 1 entries. A room may hold no keys, the same key twice, or its own key.
Besides the tests, one large input (2,500 rooms) with a ~100 ms limit (scaled to your device's speed): brute force won't pass.
Examples
can_open_all([[1],[2],[3],[]])→truecan_open_all([[2],[],[1]])→truecan_open_all([[1],[0],[3],[2]])→false