← Questions

Largest all-ones square and rectangle in a binary matrix

0
DatabricksUberCodingLast asked Apr 2026

Given a grid of 0s and 1s, return the area of the largest square made only of 1s. Then extend your approach to the largest all-ones rectangle.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding