📝 Update 0344.反转字符串.md with python3

This commit is contained in:
to_Geek
2023-11-12 23:44:17 +08:00
parent 09835e7444
commit ce2ffd073c

View File

@ -250,6 +250,20 @@ class Solution:
s[:] = [s[i] for i in range(len(s) - 1, -1, -1)]
```
(版本七) 使用reverse()
```python
class Solution:
def reverseString(self, s: List[str]) -> None:
"""
Do not return anything, modify s in-place instead.
"""
# 原地反转,无返回值
s.reverse()
```
### Go
```Go