All Downloads are FREE. Search and download functionalities are using the official Maven repository.

g0001_0100.s0073_set_matrix_zeroes.Solution.swift Maven / Gradle / Ivy

There is a newer version: 1.8
Show newest version
// #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Hash_Table #Matrix
// #Udemy_2D_Arrays/Matrix #Big_O_Time_O(m*n)_Space_O(1)
// #2024_06_24_Time_52_ms_(86.73%)_Space_16.8_MB_(16.81%)

class Solution {
    func setZeroes(_ matrix: inout [[Int]]) {
        var rows = Set()
        var columns = Set()

        //traverse the matrix
        for i in 0..




© 2015 - 2025 Weber Informatics LLC | Privacy Policy