Skip to content

Instantly share code, notes, and snippets.

@ilpropheta
Created June 4, 2016 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilpropheta/d3d8a68457d99de89a580227b6c47e89 to your computer and use it in GitHub Desktop.
Save ilpropheta/d3d8a68457d99de89a580227b6c47e89 to your computer and use it in GitHub Desktop.
auto isPalindrome = equal(begin(S), begin(S) + S.size()/2, rbegin(S));
// or, similarly
auto isPalindrome = equal(begin(S), std::next(begin(S), S.size()/2), rbegin(S));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment