Skip to content

Commit d1b94ba

Browse files
committed
Create 344.reverse-string.py
1 parent f161b92 commit d1b94ba

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

344.reverse-string.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# https://leetcode.cn/problems/reverse-string/
2+
3+
4+
class Solution:
5+
'''
6+
Date: 2023.08.07
7+
Pass/Error/Bug: 1/0/0
8+
执行用时: 48 ms, 在所有 Python3 提交中击败了 60.86% 的用户
9+
内存消耗:20.96 Mb, 在所有 Python3 提交中击败了 21.09% 的用户
10+
'''
11+
def reverseString(self, s: List[str]) -> None:
12+
"""
13+
Do not return anything, modify s in-place instead.
14+
"""
15+
for i in range(len(s)//2):
16+
s[i], s[-i-1] = s[-i-1], s[i]

0 commit comments

Comments
 (0)