Google Interview Question Cat and Mouse
Anonymous User
3387

Question was simillar to
https://leetcode.com/problems/find-the-safest-path-in-a-grid/description/
but it also blockers

Question:
there will be a grid of NxN. with a Mouse, Cat, Food.
we need to find minimum maximum safest distance so that Mouse can reach Food.
in the grid can values like 0=Land, 1=Water, and mouse can't step on Water Cell. But Cat Can.

there will be only 1-Mouse, 1-Cat, 1-Food


int findDistance(int[][] grid, int[] mouse, int[] cat, int[] food) {
	// Write Code here
}

I provided a simillar solution of PriorityQueue and BinarySearch;
with TC=> N^2 Log(N)

But interviewer was expecting an N^2 Solution. which i could't able to solve

Comments (9)