leetcode 344. 反转字符串
作者:互联网
class Solution {
public:
void reverseString(vector<char>& s) {
int size=s.size();
int i=0;
int j=size-1;
for(;i<=j;i++,j--){
char temp;
temp=s[i];
s[i]=s[j];
s[j]=temp;
}
}
};
一次通过
标签:reverseString,char,temp,int,void,344,字符串,leetcode,size 来源: https://blog.csdn.net/weixin_41606312/article/details/118926745