Skip to main content
easy

Largest Local Values in a Matrix

Find largest value in every 3x3 submatrix Return (n-2) x (n-2) matrix where each cell is max of its 3x3 window Example: [[9,9,8,1],[5,6,2,6],[8,2,6,4],[6,2,2,2]] => [[9,9],[8,6]]

Largest Local Values in a Matrix is a classic scan-and-record problem: the right bookkeeping beats brute force. It's a great warm-up that builds data-structure instincts without a ton of moving parts. The classic trap is mishandling duplicates or overwriting useful information too early.

Arrays & HashingSimulation

Meet Coco

Coco is an AI study partner, not a person. She listens while you explain your code, asks what a line does and never hands you the fix. Typing with Coco is free when you sign in, up to a daily limit. Talking with her out loud comes with the $79 pack. Anyone can open the editor and run their code.

1Largest Local Values in a Matrixeasy
2Part 2
3Part 3

Each locked part opens in the editor once the part before it passes.

Based onLeetCode