Design the Snake game on a width by height grid. Cells are written [row, col] and the top-left cell is [0, 0].
new SnakeGame(width, height, food) - the snake starts with length 1 at [0, 0]. food is an array of [row, col] pairs; only the first one not yet eaten is on the boardmove(direction) - "U", "D", "L" or "R". Return the score (the number of foods eaten so far), or -1 if the game is over- The game ends when the head leaves the grid or moves onto a cell of the snake's body. When the head moves onto the food, the snake grows by one and the next food appears. When it does not, the tail moves forward in the same turn, so the head may move into the cell the tail is leaving
- Each move should be O(1) on average