Input: arr[][] = [[2, 1, 0, 2, 1], [1, 0, 1, 2, 1], [1, 0, 0, 2, 1]];
Output: 2
Explanation: At 0th time frame:
[2, 1, 0, 2, 1]
[1, 0, 1, 2, 1]
[1, 0, 0, 2, 1]
At 1st time frame:
[2, 2, 0, 2, 2]
[2, 0, 2, 2, 2]
[1, 0, 0, 2, 2]
At 2nd time frame:
[2, 2, 0, 2, 2]
[2, 0, 2, 2, 2]
[2, 0, 0, 2, 2]
Input: arr[][] = [[2, 1, 0, 2, 1], [0, 0, 1, 2, 1], [1, 0, 0, 2, 1]]
Output: -1
Explanation: At 0th time frame:
[2, 1, 0, 2, 1]
[0, 0, 1, 2, 1]
[1, 0, 0, 2, 1]
At 1st time frame:
[2, 2, 0, 2, 2]
[0, 0, 2, 2, 2]
[1, 0, 0, 2, 2]
At 2nd time frame:
[2, 2, 0, 2, 2]
[0, 0, 2, 2, 2]
[1, 0, 0, 2, 2]
The 1 at the bottom left corner of the matrix is never rotten.