class Solution {
public:
string reverseString(string s) {
int str = 0;
int end = s.length()-1;
while (str<=end) {
char tmp;
tmp = s[str];
s[str] = s[end];
s[end] = tmp;
str++;
end--;
}
return s;
}
};
Reverse String
Copyright © 2017 Powered by LZH, Theme used GitHub CSS.