Search
⌘K

Leetcode 1997. First Day Where You Have Been in All the Rooms

Given n rooms and parity-driven movement rules determined by nextVisit, find the earliest day when every room has been visited (answer mod 1e9+7). The core challenge is to avoid slow simulation for n up to 1e5 by deriving and computing an efficient DP/recurrence that yields the first-visit day for each room under the parity-based transitions.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.