翻转字符串
class Solution:
def solve(self , str ):
# write code here
l = list(str) #模拟全部入栈
new_string = ""
while len(l)>0:
new_string += l.pop() #模拟出栈
return new_string
翻转字符串
class Solution:
def solve(self , str ):
# write code here
l = list(str) #模拟全部入栈
new_string = ""
while len(l)>0:
new_string += l.pop() #模拟出栈
return new_string