344. Reverse String
Write a function that takes a string as input and returns the string reversed.
Example:
Given s = "hello", return "olleh".
class Solution { public: string reverseString(string s) { if(s.size()==0) return s; int start = 0; int end = s.size()-1; while(start<end){ char tmp ; tmp = s[start]; s[start] = s[end]; s[end ] = tmp; start++; end--; } return s; } };