1997. First Day Where You Have Been in All the Rooms
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
class Solution:
    def firstDayBeenInAllRooms(self, nextVisit: List[int]) -> int:
        total_rooms, mod = len(nextVisit), 10**9 + 7
        visit_tracker = [0] * total_rooms
        for i in range(1, total_rooms):
            visit_tracker[i] = (2 * visit_tracker[i - 1] - visit_tracker[nextVisit[i - 1]] + 2) % mod
        return visit_tracker[-1]

```
['Python3']