class Solution {
public:
string reverseString(string s) {
int len = s.size();
for (int i=0; i<len/2; i++) {
char ch = s[i];
s[i] = s[len-i-1];
s[len-i-1] = ch;
}
return s;
}
};
#include <iostream>
using namespace std;
class Solution {
public:
string reverseString(string s) {
int i = 0, j = s.size() - 1;
while(i < j){
swap(s[i], s[j]);
i ++;
j --;
}
return s;
}
};
int main() {
cout << Solution().reverseString("hello") << endl;
return 0;
}