Leaving LeetCode
You're leaving LeetCode for an external site that may pose security risks. Continue?
https://leetcode.com/problems/snake-in-matrix/solutions/6061944/simple-commands-o-o-1-10-30-46-61/
Continue