Skip to main content
mediumBlind 75

Set Matrix Zeroes

Set entire row and column to 0 if element is 0 Input: m x n matrix Output: modified matrix (in-place and return)

Set Matrix Zeroes is a classic scan-and-record problem: the right bookkeeping beats brute force. Interviewers love it because it reveals your data-structure instincts and your edge-case discipline. Watch your edge cases around repeats, and be clear about what your map is storing.

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. Sign in free to type with Coco, up to a daily limit, and to talk with her for one hour. After that, talking comes with the $79 pack. Anyone can open the editor and run their code.

1Matrix Zero Markingmedium
Based onLeetCode

Get a note when something new lands

New company guides, new problems and big changes to Coco. Rare, and you can leave any time. By joining you agree to get these emails.