Search
⌘K
Leetcode 913. Cat and Mouse
Two players alternate moves along edges of an undirected graph: the mouse starts at 1, the cat at 2 (cat cannot enter node 0), and the game ends if the mouse reaches hole 0 (mouse wins), the cat lands on the mouse (cat wins), or a position repeats (draw). Determine which of the three outcomes occurs under optimal play — essentially resolving a finite game-state graph (mouse, cat, turn) with cycles/draws via retrograde analysis/BFS.
Asked at:
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Early January, 2026
Staff
No constraints were added, could be any shape. A lot of focus on test cases.
Late December, 2024
Mid-level
Cat and Mouse game
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.