Search
⌘K

Leetcode 221. Maximal Square

Given an m×n binary matrix, find the area of the largest axis-aligned square submatrix that contains only '1's. This is a classic DP problem (m,n ≤ 300) of computing the maximal square size at each cell and returning its area.

Asked at:

Expedia


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Mid January, 2026

Expedia

Mid-level

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

Your account is free and you can post anonymously if you choose.