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. 关闭IE窗口

    $a=(New-Object -comObject Shell.Application).Windows() ($a|?{$_.locationname -eq "人力与人才信息管理系统&q ...

  2. Out of resources when opening file 错误解决

    mysqldump: Got error: 23: Out of resources when opening file ‘./mydb/tax_calculation_rate_title.MYD’ ...

  3. 安卓 SQLite数据库操作实例

    前段时间写了个安卓平台下SQLite数据库操作的实例 ,一直没得时间总结 ,今天把它弄出来了. 在Android 运行时环境包含了完整的 SQLite. 首先介绍一下SQLite这个数据库: SQLi ...

  4. 【JavaScript】你知道吗?Web的26项基本概念和技术

    Web开发是比较费神的,需要掌握很多很多的东西,特别是从事前端开发的朋友,需要通十行才行.今天,本文向初学者介绍一些Web开发中的基本概念和用到的技术,从A到Z总共26项,每项对应一个概念或者技术. ...

  5. SQL注入原理解说,非常不错!

    原文地址:http://www.cnblogs.com/rush/archive/2011/12/31/2309203.html 1.1.1 摘要 日前,国内最大的程序猿社区CSDN站点的用户数据库被 ...

  6. LINUX内核笔记

    http://blog.chinaunix.net/uid/27119491/list/1.html?cid=161103

  7. Ubuntu下安装FTP服务及使用(以VSFTPD为例)

    (一)安装与配置 (1)       安装vsftpd $sudo apt-get install vsftpd 这里会提示无法创建/home/ftp目录,手动创建一个 $sudo mkdir /ho ...

  8. 基于CSS3制作的鼠标悬停动画菜单

    之前分享了好多款css3实现的鼠标悬停效果.今天再给大家带来一款基于CSS3制作的鼠标悬停动画菜单.这款菜单适用浏览器:360.FireFox.Chrome.Safari.Opera.傲游.搜狗.世界 ...

  9. linux学习资料

    鸟哥的Linux私房菜 基础学习篇(第三版)    http://book.51cto.com/art/201007/211888.htm 鸟哥的Linux私房菜——服务器架设篇    http:// ...

  10. php.ini的配置

    一.user_agent ini_set('user_agent','Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)') user_agent,再 ...