Vivek encounter problem he maze represent n time m grid each grid cell represent follow Empty Wall good person g bad person b the escape maze cell n mA person cell share current cell contain wall Vivek want block cell replace wall way good people able escape bad people able a cell initially contain G B block travel throughhelp determine exist way replace zero cell wall satisfy conditionsIt guarantee cell nm Vivek block cell