Given a binary matrix, return the total number of square submatrices that contain only 1s.
Constraints
Example
>>> count_squares([[1,0,1],[1,1,0],[1,1,0]]) 7 >>> count_squares([[0,0,0],[0,0,0]]) 0 >>> count_squares([[1]]) 1
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints