Largest Plus Sign
Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.
Practice this as a mock interviewFree to start, no account neededProblem
Start with an n x n grid filled with 1s, then set to 0 every cell listed in mines (each entry is [row, col]).
An axis-aligned plus sign of **order** k is a center cell of 1 with four arms of 1s extending k - 1 cells up, down, left, and right from it. Order 1 is a single 1. Cells outside the arms don't matter.
Return the largest order of any plus sign in the grid, or 0 if the grid has no 1 at all.
Examples
Constraints
- `1 <= n <= 500`
- `0 <= mines.length <= 5000`
- `0 <= row, col < n`
- All mine positions are distinct
What the interviewer grades
A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.