
g0001_0100.s0073_set_matrix_zeroes.Solution.swift Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of leetcode-in-all Show documentation
Show all versions of leetcode-in-all Show documentation
104 LeetCode algorithm problem solutions
// #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