573. Maximal Square
You have a strong interest in identifying square shapes within a puzzle grid. Given a binary matrix of size n x n, where each element is either 0 or 1, your task is to find the largest square that consists only of 1's and print its area.
The first line of input contains an integer n, representing the size of the matrix. The following n lines contain binary strings of length n.
Print the area of the largest square.
3 1 0 0 1 1 1 0 1 1
* 1 <= n <= 300 * Each element in the matrix is either '0' or '1'