Everlaw interview question

coding challenge (snake game on codesandbox)