Created
November 10, 2018 03:24
-
-
Save tabvn/232cb548b3fdf4739411c70d4fcfad6a 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 doiXung(string s, long long length){ | |
| if(length == 1){ | |
| return true; | |
| } | |
| bool dx = false; | |
| long long i, j; | |
| i = 0; | |
| j = length - 1; | |
| while(s[i] == s[j]){ | |
| if(i >= j){ | |
| dx = true; | |
| } | |
| i++; | |
| j--; | |
| } | |
| return dx; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment