Skip to content

Commit 2b262e6

Browse files
authored
Update Reverse String - Leetcode 344.py
1 parent 40283ad commit 2b262e6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Reverse String - Leetcode 344.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ def reverseString(self, s: List[str]) -> None:
66
n = len(s)
77
l = 0
88
r = n - 1
9+
910
while l < r:
1011
s[l], s[r] = s[r], s[l]
1112
l += 1
12-
r -= 1
13+
r -= 1
14+
15+
# Time Complexity: O(n)
16+
# Space Complexity: O(1)

0 commit comments

Comments
 (0)