feat(0344-reverse-string): add py3 solution
This commit is contained in:
13
0344_reverse-string/python3/solution.py
Normal file
13
0344_reverse-string/python3/solution.py
Normal file
@@ -0,0 +1,13 @@
|
||||
class Solution:
|
||||
def reverseString(self, s: List[str]) -> None:
|
||||
"""
|
||||
Do not return anything, modify s in-place instead.
|
||||
"""
|
||||
i = 0
|
||||
j = len(s) - 1
|
||||
|
||||
while i < j:
|
||||
s[i], s[j] = s[j], s[i]
|
||||
i += 1
|
||||
j -= 1
|
||||
|
||||
Reference in New Issue
Block a user