您的位置:首页 > 其它

[LeetCode]344. Reverse String

2017-09-24 21:16 330 查看
Write a function that takes a string as input and returns the string reversed.

Example:

Given s = “hello”, return “olleh”.

代码长这样~

class Solution {
public String reverseString(String s) {
return new StringBuffer(s).reverse().toString();
}
}


咦,我刚做完557就来做这道题,它要是早点出现我也不会写557写了那么久(;′⌒`) 摔桌
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  leetcode