Created
June 4, 2016 13:23
-
-
Save ilpropheta/212de4906c4b4908b3f88f8b318177c2 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
if (equal(begin(S), begin(S) + S.size()/2, rbegin(S))) // is palindrome? | |
cout << diffIdx << endl; | |
else | |
cout << S.size() - diffIdx - 1 << endl; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment