Skip to content

Commit

Permalink
📝 Update 0344.反转字符串.md with python3
Browse files Browse the repository at this point in the history
  • Loading branch information
qiu121 committed Nov 12, 2023
1 parent 09835e7 commit ce2ffd0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions problems/0344.反转字符串.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ce2ffd0

Please sign in to comment.