Given an m x n binary grid where cells contain either 0 or 1, find the largest square subgrid whose boundary consists entirely of 1s. The interior cells of the square can be either 0 or 1. Return the total number of cells in this square (its area). If no such square exists, return 0.
Visualizer will appear here