์ฝ๋
class Solution {
public void reverseString(char[] s) {
int left = 0;
int right = s.length -1;
while (left < right) {
char temp = s[left];
s[left] = s[right];
s[right] = temp;
left++;
right--;
}
}
}
Java
๋ณต์ฌ
๋ฌธ์ ํด๊ฒฐ ์์ด๋์ด
๋ ๋จน๋ swap์ผ๋ก ์ฃผ์ธ์