Rat chases ts cheese

why this code is giving segmentation fault.
link to my code–>

you have to put one base case

if(sol[i][j]==1)return false;
otherwise it stuck into a cycle and runtime error occur
after that it will run fine

i hope this help
if you have more doubts regarding this feel free to ask
if your doubt is resolved mark it as resolved from your doubt section inside your course