344. 反转字符串

请编写一个函数,其功能是将输入的字符串反转过来。

示例:

输入:s = "hello"
返回:"olleh"
class Solution:
    def reverseString(self, s):
        """
        :type s: str
        :rtype: str
        """
        return ''.join(list(s)[::-1])
posted @ 2018-07-18 22:31  yuyin  阅读(68)  评论(0编辑  收藏  举报