There are `n` rooms labeled `0` to `n - 1`. You start in room `0`. Each room `i` contains a list of keys `rooms[i]`, each opening another room.
Return `true` if you can visit **all** the rooms, otherwise `false`.
Example 1
Input:rooms = [[1],[2],[3],[]]
Output:true
Explanation:0 -> 1 -> 2 -> 3.
Example 2
Input:rooms = [[1,3],[3,0,1],[2],[0]]
Output:false
Explanation:Room 2 is never reachable.
Constraints
- n == rooms.length
- 2 <= n <= 1000
- rooms[i] contains distinct values in [0, n - 1]