Skip to content

Instantly share code, notes, and snippets.

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/77ab2f4f52de0d74aae977ba8e878e89 to your computer and use it in GitHub Desktop.
Save ilpropheta/77ab2f4f52de0d74aae977ba8e878e89 to your computer and use it in GitHub Desktop.
// reverse S into tmp
auto tmp = S;
for (auto i=0u; i<tmp.size()/2; ++i)
{
std::swap(tmp[i], tmp[tmp.size()-i-1]);
}
cout << (S==tmp ? "YES" : "NO");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment