Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1f6d7dc

Browse files
committedMay 18, 2022
Time: 163 ms (15.58%), Space: 49.2 MB (78.65%) - LeetHub
1 parent 88d739e commit 1f6d7dc

File tree

1 file changed

+16
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)
Please sign in to comment.