Funky Chess Board Segmentation Fault


i am unable to apply all required conditions …plzz check the code i’m getting segmentation fault

the problem in your code is that once you are not covering all the cases simultaneously i.e. you should not apply if condition as you have to find the cells which can’t be visited given the condition that once a cell is visited than it can’t be visited again (which your program is not considering).

So, let’s discuss the solution so what you need to do is once you visit a cell, then visit all the cells that can be visited from this cell and also visit the cells that can be further visited from the next reachable cells.

check code here , i have explained the logic along with the code :-

In case of any doubt feel free to ask :slight_smile: