Peeush Agarwal > Engineer. Learner. Builder.

I am a Machine Learning Engineer passionate about creating practical AI solutions using Machine Learning, NLP, Computer Vision, and Azure technologies. This space is where I document my projects, experiments, and insights as I grow in the world of data science.

View on GitHub

Set Matrix Zeroes

Problem Statement

Given an m x n integer matrix, your task is to set the entire row and column to zero if any element in the matrix is zero. The operation must be performed in place.

Examples

Example 1:

Example 1

Example 2:

Example 2

Constraints

Follow Up

Code Template

class Solution:
    def setZeroes(self, matrix: List[List[int]]) -> None:
        # Your code here
        pass

Solutions

Back to Problem List Back to Categories