Created
September 28, 2017 12:05
-
-
Save freelze/dae9cd3fe78ebbaf7c2c7c0dd0433ffb to your computer and use it in GitHub Desktop.
Runtime: 9 ms , Your runtime beats 23.85 % of cpp submissions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution { | |
public: | |
string reverseString(string s) { | |
string temp; for(string::reverse_iterator rit=s.rbegin();rit!=s.rend();rit++) temp.push_back(*rit); | |
return temp; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment