Write a function that takes a string as input and returns the string reversed.
Example:
Given s = "hello", return "olleh".
my answer:
class Solution {
public:
string reverseString(string s) {
{
string a;
int length = s.length();
for(int i = length-1;i>=0;i--)
a+=s[i];
return a;
}
}
};