Skip to content

Instantly share code, notes, and snippets.

@Se7soz
Last active January 3, 2016 05:09
Show Gist options
  • Save Se7soz/8414151 to your computer and use it in GitHub Desktop.
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
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