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

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

public class Solution {
public String reverseString(String s) {
StringBuilder sb=new StringBuilder();
sb.append(s);
return sb.reverse().toString();
}
}

每天一道LeetCode--344. Reverse String的更多相关文章

  1. [LeetCode] 344 Reverse String && 541 Reverse String II

    原题地址: 344 Reverse String: https://leetcode.com/problems/reverse-string/description/ 541 Reverse Stri ...

  2. Leetcode#344. Reverse String(反转字符串)

    题目描述 编写一个函数,其作用是将输入的字符串反转过来. 示例 1: 输入: "hello" 输出: "olleh" 示例 2: 输入: "A man ...

  3. leetcode 344. Reverse String 、541. Reverse String II 、796. Rotate String

    344. Reverse String 最基础的旋转字符串 class Solution { public: void reverseString(vector<char>& s) ...

  4. LeetCode 344. Reverse String(反转字符串)

    题目描述 LeetCode 344. 反转字符串 请编写一个函数,其功能是将输入的字符串反转过来. 示例 输入: s = "hello" 返回: "olleh" ...

  5. [LeetCode] 344. Reverse String 翻转字符串

    Write a function that reverses a string. The input string is given as an array of characters char[]. ...

  6. Leetcode 344 Reverse String 字符串处理

    题意:反转字符串,用好库函数. class Solution { public: string reverseString(string s) { reverse(s.begin(),s.end()) ...

  7. LeetCode 344. Reverse String

    Problem: Write a function that takes a string as input and returns the string reversed. Example: Giv ...

  8. Python [Leetcode 344]Reverse String

    题目描述: Write a function that takes a string as input and returns the string reversed. Example:Given s ...

  9. (字符串 数组 递归 双指针) leetcode 344. Reverse String

    Write a function that reverses a string. The input string is given as an array of characters char[]. ...

  10. LeetCode Javascript实现 344. Reverse String 292. Nim Game 371. Sum of Two Integers

    344. Reverse String /** * @param {string} s * @return {string} */ var reverseString = function(s) { ...

随机推荐

  1. JDBC-ODBC桥乱码问题解决方案

    按照网上提供的ODBC连接数据库的相关资料编写代码,成功编译后运行发现,非中文字段显示正确,而中文字段却是每个汉字以?显示.关于这方面的错误baidu或google下可以找到很多解答方案,我也尝试过其 ...

  2. linux系统命令解析(0基础篇)

    经常使用命令 ctrl+W+T    当进入gvim文档编辑界面后,假设是C文件,能够列出当前文件里的全部函数. Shift+*    当进入gvim文档编辑页面,能够搜索当前keyword. ech ...

  3. ARM&Linux 下驱动开发第二节

    驱动文件:qudong.c,make生成qudong.ko文件,烧录到ARM板上 #include<linux/init.h> #include<linux/module.h> ...

  4. 关于form.submit()不能提交表单的错误原因

    来源:http://www.ido321.com/948.html 直接上代码把: 1: <div id="register"> 2: <h4>会员注冊&l ...

  5. CodeForces 173A Rock-Paper-Scissors 数学

    Rock-Paper-Scissors 题目连接: http://codeforces.com/problemset/problem/173/A Description Nikephoros and ...

  6. Qt学习之自定义窗口部件

    自定义Qt窗口部件 实现一个十六进制的SpinBox,一般SpinBox只支持十进制整数,但是可以子类化方法实现该功能 需重新实现以下虚函数 virtual QString textFromValue ...

  7. linux下登入mysql和加压zip文件

    1.类似于window中cmd登入一样 : mysql -u root -p   ---->  回车 ---> 输入密码  就可以了 2. unzip abc.zip  直接进行解压    ...

  8. [Java] 识别图片验证码

    现在大多数网站都采用了验证码来防止暴力破解或恶意提交.但验证码真的就很安全吗?真的就不能被机器识别?? 我先讲讲我是怎么实现站外提交留言到一个网站的程序. 这个网站的留言版大致如下: 我一看这种简单的 ...

  9. 【OC语法快览】四、基础内存管理

    Basic Memory Management                                                           基础内存管理 If you're w ...

  10. 0c-39-ARC下单对象内存管理

    1.ARC工作原理详述 ARC是Objective-C编译器的特性,而不是运行时特性或者垃圾回收机制,ARC所做的只不过是在代码编译时为你自动在合适的位置插入release或autorelease A ...