Funky chess board wrong answer on all the testcases

WRONG ANSWER ON ALL THE TESTCASES.
I HAVE USED DFS