Passed all test cases for Snake