Created
June 3, 2016 17:56
-
-
Save ilpropheta/77ab2f4f52de0d74aae977ba8e878e89 to your computer and use it in GitHub Desktop.
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
// 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