【Python】344. Reverse String

xiaoxiao2021-02-28  41

偷懒用了Python= = 终于自己实现了一次一行解决问题的美好愿望QAQ

题目: Pick One

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

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

解答: class Solution(object): def reverseString(self, s): """ :type s: str :rtype: str """ return s[::-1]
转载请注明原文地址: https://www.6miu.com/read-2631748.html

最新回复(0)