You are given a 2-D grid of size m × n containing only "0" and "1".
Find the largest square made up of only "1" cells and return its area (number of cells inside that square).
Input: matrix = [ ["1","0","1","0","0"], ["1","1","1","1","0"], ["1","1","1","1","1"], ["0","1","1","1","0"] ]
Output: 4
Explanation:
The biggest square of all 1s has side length 2, so area = 2×2 = 4.
Input: matrix = [ ["0","1"], ["1","1"] ]
Output: 1
Explanation:
The largest square of only 1s has side length 1, so area = 1.
Input: matrix = [ ["0"] ]
Output: 0
Explanation:
No 1s are present, so the area is 0.
Accepted:
Submission: