Skip to content

Commit 54db6fc

Browse files
committed
Update solution 344 [Python3]
1 parent 0c625f6 commit 54db6fc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class Solution:
2+
def reverseString(self, s):
3+
"""
4+
:type s: str
5+
:rtype: str
6+
"""
7+
length=len(s)
8+
if length < 2:
9+
return s
10+
ns=''
11+
p=length-1
12+
while p >= 0:
13+
ns += s[p]
14+
p-=1
15+
return ns

0 commit comments

Comments
 (0)