344.Reverse String

来源:互联网 发布:淘宝网是怎么盈利的 编辑:程序博客网 时间:2024/05/07 01:29

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]
0 0
原创粉丝点击