Merge pull request #169 from tianshengsui/master

添加0344.反转字符串Python3版本
This commit is contained in:
Carl Sun
2021-05-18 15:27:00 +08:00
committed by GitHub

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