Tap here to switch tabs
Problem
Submissions

Problem: Largest 1-Bordered Square

med
30 min
Try to solve the Largest 1-Bordered Square problem.

Statement

Given a 22D grid of 00s and 11s named grid, find the maximum number of elements contained in a square subgrid such that all elements along its border are 11. If no such subgrid exists, return 00.

Constraints:

  • 1≤1 \leq grid.length ≤100\leq 100

  • 1≤1 \leq grid[0].length ≤100\leq 100

  • grid[i][j] is 00 or 11

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Largest 1-Bordered Square

med
30 min
Try to solve the Largest 1-Bordered Square problem.

Statement

Given a 22D grid of 00s and 11s named grid, find the maximum number of elements contained in a square subgrid such that all elements along its border are 11. If no such subgrid exists, return 00.

Constraints:

  • 1≤1 \leq grid.length ≤100\leq 100

  • 1≤1 \leq grid[0].length ≤100\leq 100

  • grid[i][j] is 00 or 11