LeetCode-344:Reverse String

时间:2021-11-16 14:22:56

This  is a  "Pick One" Problem :【Problem:344-Reverse String

Write a function that takes a string as input and returns the string reversed.

Example:
Given s = "hello", return "olleh".

Python实现字符串反转: s [::-1]

class Solution:
def reverseString(self, s):
"""
:type s: str
:rtype: str
"""
s=input("请输入需要反转的内容:")
return s[::-1]

But:

LeetCode-344:Reverse String