Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ce2ffd0

Browse files
committed
📝 Update 0344.反转字符串.md with python3
1 parent 09835e7 commit ce2ffd0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

‎problems/0344.反转字符串.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,20 @@ class Solution:
250250
s[:] = [s[i] for i in range(len(s) - 1, -1, -1)]
251251

252252
```
253+
254+
(版本七) 使用reverse()
255+
256+
```python
257+
class Solution:
258+
def reverseString(self, s: List[str]) -> None:
259+
"""
260+
Do not return anything, modify s in-place instead.
261+
"""
262+
# 原地反转,无返回值
263+
s.reverse()
264+
265+
```
266+
253267
### Go:
254268

255269
```Go

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /