题目原文:
Write a function that takes a string as input and returns the string reversed.
题目大意:
翻转字符串。
分析:
用python的切片最为简单。[::-1]就代表逆序
源码:(language:python)
class Solution(object):
def reverseString(self, s):
return s[::-1]
成绩:
80ms
本文介绍了一种使用Python语言实现字符串翻转的方法。通过简单的切片操作[::-1]即可轻松实现字符串的逆序排列。
8557

被折叠的 条评论
为什么被折叠?



