diff --git a/swift/special-positions-in-a-binary-matrix.swift b/swift/special-positions-in-a-binary-matrix.swift new file mode 100644 index 0000000..a8f8a32 --- /dev/null +++ b/swift/special-positions-in-a-binary-matrix.swift @@ -0,0 +1,25 @@ +class Solution { + func numSpecial(_ mat: [[Int]]) -> Int { + let m = mat.count + let n = mat[0].count + + var rows: [Int] = Array(repeating: 0, count: m) + var cols: [Int] = Array(repeating: 0, count: n) + + for (y, x) in (0..