题目描述
思路:左右指针
方法一:
class Solution {
public void reverseString(char[] s) {
int left = 0, right = s.length - 1;
while (left < right) {
char temp = s[left];
s[left] = s[right];
s[right] = temp;
left ++;
right --;
}
}
}
标签:right,temp,LeetCode344,char,字符串,left,刷题
From: https://www.cnblogs.com/keyongkang/p/17963792