Reported interview periodNov 2025
Largest All-Ones Square and Rectangle
Given a binary matrix containing characters '0' and '1', return the area of the largest axis-aligned region containing only ones.
Practice focusImplementation requirements 1. Implement maximal square . An empty matrix or a matrix containing no ones returns 0 . 2. Extend the solution to maximal rectangle , where height and width may differ. Inputs are rectangular lists of rows containing only the strings '0' and '1' ; empty matrices and zero-column matrices return 0 . Return an integer area without modifying the input. Malformed rows are outside the assessed input contract. Target O(rows cols) time.…