← All problemsSign in

3071. Minimum Operations to Write the Letter Y on a Grid

LeetCodeArrayHash TableMatrixCountingOpen on judge ↗

You are given a 0-indexed n x n grid where n is odd, and grid[r][c] is 0, 1, or 2. We say that a cell belongs to the Letter Y if it belongs to one of the following: - The diagonal starting at the top-left cell and ending at the center cell of the grid. - The diagonal starting at the top-right cell and ending at the center cell of the grid. - The vertical line starting at the center cell and en

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start