Skip to content

Commit

Permalink
Time: 0 ms (100.00%), Space: 49.1 MB (41.33%) - LeetHub
Browse files Browse the repository at this point in the history
  • Loading branch information
YubinShin committed Aug 26, 2024
1 parent 060fe9a commit 837d30f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions 0344-reverse-string/0344-reverse-string.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class Solution {
public void reverseString(char[] s) {
int start = 0;
int end = s.length - 1;

while (start < end) {
char temp = s[start];
s[start] = s[end];
s[end] = temp;

start++;
end--;
}
}
}

0 comments on commit 837d30f

Please sign in to comment.