Write a function that takes a string as input and returns the string reversed.
Example:
Given s = "hello", return "olleh".
Maybe, the point to watch out here is the last '\0'??
string reverseString(string s) {
if(s.size() <= 1) return s;
int i = 0;
int j = s.size() - 1;
while(i < j) {
swap(s[i], s[j]);
i++;
j--;
}
return s;
}