image_2021-12-13_00-32-47.png
23 KB
#N344. Reverse String
problem link
#solution
problem link
#solution
class Solution {
public void reverseString(char[] s) {
for(int i=0; i<s.length/2; i++){
char tmp = s[i];
s[i] = s[s.length-1-i];
s[s.length-1-i] = tmp;
}
}
}