2017/11/6 Leetcode 日记
344. Reverse String
Write a function that takes a string as input and returns the string reversed.
class Solution { public: string reverseString(string s) { int i = 0, sz = s.size()-1; for(i = 0; i < sz; i++, sz--){ char temp = s[i]; s[i] = s[sz]; s[sz] = temp; } return s; } };