Maximal Square

Given an m x n binary matrix filled with '0' and '1', find the largest square containing only '1's and return its area.

Input format: the first line has m and n, followed by m lines, each a strin...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: