Easy-题目70:344. Reverse String(增补3)

原创 2016年05月30日 22:50:21

题目原文:
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

版权声明:完整版Leetcode题解请出门左转https://github.com/cmershen1/leetcode/tree/master/docs

相关文章推荐

leetcode_easy 344、reverse string

344、reverse string//注意c串的结尾 #include #include #include using namespace std; string reverseString(st...
  • scylhy
  • scylhy
  • 2016年09月05日 20:22
  • 282

344_Reverse String

class Solution { public: string reverseString(string s) { int len = s.length(); ...

【LeetCode】344. Reverse String

344. Reverse String Write a function that takes a string as input and returns the string reversed....
  • jeff_35
  • jeff_35
  • 2016年12月01日 22:35
  • 126

【LeetCode】344. Reverse String 解题报告

转载请注明出处:http://blog.csdn.net/crazy1235/article/details/51416284Subject 出处:https://leetcode.com/pro...

<LeetCode OJ> 345 / 344 Reverse Vowels of a String / Reverse String

Total Accepted: 537 Total Submissions: 1488 Difficulty: Easy Write a function that takes a stri...

345. Reverse Vowels of a String [easy] (Python)

题目链接https://leetcode.com/problems/reverse-vowels-of-a-string/题目原文 Write a function that takes a st...

leetcode解题之344. Reverse String & 345. Reverse Vowels of a String Java版(反转字符串)

leetcode解题之344. Reverse String & 345. Reverse Vowels of a String Java版(反转字符串)

Reverse Vowels of a String (easy)

【题目】       Write a function that takes a string as input and reverse only the vowels of a string....
  • haihaa
  • haihaa
  • 2016年05月15日 09:53
  • 114

36. Valid Sudoku\434. Number of Segments in a String\344. Reverse String\345. Reverse Vowels of a St

Valid Sudoku 题目描述 代码实现 Number of Segments in a String 题目描述 代码实现 Reverse String 题目描述 代码实现 Reverse Vow...

[LeetCode]344. Reverse String&345. Reverse Vowels of a String&151. Reverse Words in a String

344. Reverse String 345. Reverse Vowels of a String 151. Reverse Words in a String
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Easy-题目70:344. Reverse String(增补3)
举报原因:
原因补充:

(最多只允许输入30个字)