Created
February 24, 2017 00:43
-
-
Save hikilaka/6d4e4b88ba873108034888f92fe0dff6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
bool checkPalindrome(std::string inputString) { | |
auto begin = inputString.begin(); | |
auto end = inputString.end(); | |
auto rbegin = inputString.rbegin(); | |
for (; begin != end;) { | |
if (*begin != *rbegin) { | |
return false; | |
} | |
begin = std::next(begin); | |
rbegin = std::next(rbegin); | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment