A game is played by a cat and a mouse named Cat and Mouse.
The environment is represented by a grid of size rows x cols, where each element is a wall, floor, player (Cat, Mouse), or food.
'C' (Cat) and 'M' (Mouse)'.' and can be walked on'#' and cannot be walked on'F' and can be walked on'C', 'M', and 'F' in gridMouse and Cat play according to the following rules:
gridcatJump and mouseJump are the maximum lengths Cat and Mouse can jump at a time, respectively. Cat and Mouse can jump less than the maximum lengthThe game can end in 4 ways:
Given a rows x cols matrix grid and two integers catJump and mouseJump, return true if Mouse can win the game if both Cat and Mouse play optimally, otherwise return false.
rows == grid.lengthcols == grid[i].length1 <= rows, cols <= 8grid[i][j] consists only of characters 'C', 'M', 'F', '.', and '#''C', 'M', and 'F' in grid1 <= catJump, mouseJump <= 8grid = ["####F","#C...","M...."], catJump = 1, mouseJump = 2truegrid = ["M.C...F"], catJump = 1, mouseJump = 4truegrid = ["M.C...F"], catJump = 1, mouseJump = 3false