Skip to content

Commit 389d6ff

Browse files
authoredOct 15, 2022
Create ReverseString.py
1 parent 063f037 commit 389d6ff

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎easy/ReverseString.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#344. Reverse String
2+
class Solution:
3+
def reverseString(self, s: List[str]) -> None:
4+
l = 0
5+
r = len(s) - 1
6+
7+
while l < r:
8+
s[l], s[r] = s[r], s[l]
9+
l += 1
10+
r -= 1

0 commit comments

Comments
 (0)
Please sign in to comment.