Given a binary grid where 1 is land and 0 is water, a cell can be changed from land to water in one day. The grid is 'connected' if it has exactly one island (a maximal 4-directionally connected group of land). Return the minimum number of days to make the grid disconnected (zero islands or more than one island). The answer is always 0, 1, or 2. The input is JSON {grid}.
Input: JSON {grid}.
Output: Integer — the minimum days (0, 1, or 2).
Input: {"grid":[[0,1,1,0],[0,1,1,0],[0,0,0,0]]}
Output: 2
Explanation: A solid block needs 2 removals.Input: {"grid":[[1,1]]}
Output: 2
Explanation: Two-cell island.Input: {"grid":[[1,0,1,0]]}
Output: 0
Explanation: Already disconnected (two islands).1<=m,n<=30