添加0344.反转字符串Python3版本

This commit is contained in:
Tiansheng Sui
2021-05-17 17:11:23 -07:00
committed by GitHub
parent b0edeca71f
commit 7e171a3d2f

View File

@ -157,7 +157,18 @@ class Solution {
```
Python
```python3
class Solution:
def reverseString(self, s: List[str]) -> None:
"""
Do not return anything, modify s in-place instead.
"""
left, right = 0, len(s) - 1
while(left < right):
s[left], s[right] = s[right], s[left]
left += 1
right -= 1
```
Go
```Go