Google | Phone Screen | Count Zero Squares
Anonymous User
3653

Count the number of squares in the matrix of zeros and ones, which consist only of zeros.

Example:

Input
[[0, 0, 0]
 [0, 0, 0]
 [0, 0, 1]]

Output: 11
 
Explanation:
In len 1, there are 8 squares there.
In len 2, there are 3 squares there.
In len 3, there are 0 square there.
So total is 11.
Comments (3)