Skip to content

Commit 20081b2

Browse files
authored
Merge pull request #244 from akhand123/master
added solution for leetcode# 344 in javascript
2 parents 898775c + e24a829 commit 20081b2

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

leetcode/Javascript/.DS_Store

6 KB
Binary file not shown.

leetcode/Javascript/String/344.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* @param {character[]} s
3+
* @return {void} Do not return anything, modify s in-place instead.
4+
*/
5+
6+
var reverseString = function(s) {
7+
const helper = function(left, right) {
8+
if (left < right) {
9+
[s[left], s[right]] = [s[right], s[left]]
10+
helper(left + 1, right - 1)
11+
}
12+
}
13+
helper(0, s.length - 1)
14+
};

0 commit comments

Comments
 (0)