Funky chess board


this passing all test cases how can i modified it to print the maximum traversed path??