Maximal Square

Given a binary matrix, find out the largest size square sub-matrix with all 1's and return its area.

Example:

Input:

10100
10111
11110
10010

Output:

4

Try it yourself