No problems found.
Expected Time Complexity
O(m * n)
Expected Space Complexity
O(m * n)
Input:
[ ["1","1","1","1","0"], ["1","1","0","1","0"], ["1","1","0","0","0"], ["0","0","0","0","0"] ]
Output:
1
Input:
[ ["1","1","0","0","0"], ["1","1","0","0","0"], ["0","0","1","0","0"], ["0","0","0","1","1"] ]
Output:
3