Find the largest square of 1s in a binary matrix using dynamic programming.
Constraints
Example
>>> maximal_square([[1,0,1,0,0],[1,0,1,1,1],[1,1,1,1,1],[1,0,0,1,0]]) 2 >>> maximal_square([[0,0],[0,0]]) 0 >>> maximal_square([[1]]) 1
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints