Skip to content

Commit a815df1

Browse files
committed
add complexity
1 parent 1c50a56 commit a815df1

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

longest-substring-without-repeating-characters/delight010.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
class Solution {
2+
// Time complexity O(N)
3+
// Space complexity O(min(m,n))
24
func lengthOfLongestSubstring(_ s: String) -> Int {
35
if s.isEmpty {
46
return 0

set-matrix-zeroes/delight010.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
class Solution {
2+
// Time complexity O(MN)
3+
// Space complexity O(1)
24
func setZeroes(_ matrix: inout [[Int]]) {
35
var firstRowHasZero = false
46
var firstColHasZero = false

0 commit comments

Comments
 (0)