您的位置:首页 > 其它

[leetcode]344. Reverse String

2016-05-14 21:18 239 查看
Write a function that takes a string as input and returns the string reversed.

Example:

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

Subscribe to see which companies asked this question

不知道自己会不会精分

javascript版本

/**
* @param {string} s
* @return {string}
*/
var reverseString = function(s) {
return s.split("").reverse().join("");
};


python版本
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: