Search
⌘K
Get Premium
Leetcode 3248. Snake in Matrix
Simulate the snake moving on an n×n grid (cells labeled row-major as i*n + j) starting at cell 0, applying the sequence of UP/RIGHT/DOWN/LEFT commands and return the final cell index (movement is guaranteed to stay within bounds).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.