Example 1
Example 2
2 <= n <= 101 <= commands.length <= 100commands consists only of "UP", "RIGHT", "DOWN", and "LEFT".The input is generated such the snake will not move outside of the boundaries.Example 1
Example 2
2 <= n <= 101 <= commands.length <= 100commands consists only of "UP", "RIGHT", "DOWN", and "LEFT".The input is generated such the snake will not move outside of the boundaries.