Algorithm · Airwallex · Medium
Implement largest_square_area(matrix: list[list[int]]) -> int. You are given a rectangular grid of binary values. A square is axis-aligned when its sides run parallel to the grid's rows and columns. Find the largest possible area of an all-1 axis-aligned square. Return the area, i.e. the square of the side length, not the side length. If the grid has no rows, every row has length 0, or no cell equals 1, return 0. If there are multiple largest squares, return the area they…
Checking your access…