My Code https://ide.codingblocks.com/s/155373
Hackerblock link https://hack.codingblocks.com/app/contests/987/p/570
It shows TLE on hackerblocks
Hi @harshkumar.877587
Use a visited matrix to check for already visited places to avoid tle. Checking the sol[i][j] don’t work out because you set it 1 when you when you go to maze[i][j] and then set 0 when you return. Visited[i][j] matrix remains to 1 when you visit maze[i][j].
Hope it helps
Give a like if you are satisfied