DFS or BFS is the intuitive solution for this problem while the problem is with a tag "binary search". So can anyone provide a binary search answer. DFS complexity is O(m * n) and if binary search it would be O(n * lgm + m * lgn)

```
public class Solution {
private int minX = Integer.MAX_VALUE, minY = Integer.MAX_VALUE, maxX = 0, maxY = 0;
public int minArea(char[][] image, int x, int y) {
if(image == null || image.length == 0 || image[0].length == 0) return 0;
dfs(image, x, y);
return(maxX - minX + 1) * (maxY - minY + 1);
}
private void dfs(char[][] image, int x, int y){
int m = image.length, n = image[0].length;
if(x < 0 || y < 0 || x >= m || y >= n || image[x][y] == '0') return;
image[x][y] = '0';
minX = Math.min(minX, x);
maxX = Math.max(maxX, x);
minY = Math.min(minY, y);
maxY = Math.max(maxY, y);
dfs(image, x + 1, y);
dfs(image, x - 1, y);
dfs(image, x, y - 1);
dfs(image, x, y + 1);
}
}
```