Rat chase its cheese

one of the test cases not passed

hello @Rishabhsharm
check ur updated code here.

a) very first step u should do is check whether the current state is safe or not thats why this if should be on very top .


also u have to add that highted condition (this is done to avoid visiting same state again n again).

b)


intialise with false and added extra conditons to avoid negative/invalid indices.