Last active
January 3, 2016 05:09
-
-
Save Se7soz/8414151 to your computer and use it in GitHub Desktop.
Read the How to prepare for an interview series at my blog: http://se7so.blogspot.com/2014/01/how-to-prepare-for-interview.html
This file contains 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
string reverse(string s) { | |
int len = s.size(); | |
for(int i = 0; i < len/2; i++) { | |
swap(s[i], s[len-i-1]); | |
} | |
return s; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment