Amazon Interview Question

Problems similar to rotten oranges /burning tree. And a matrix ques.