We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df0d71c commit 3b86fe8Copy full SHA for 3b86fe8
valid-palindrome/aa601.c
@@ -0,0 +1,27 @@
1
+bool isPalindrome(char* s) {
2
+ int i;
3
+ int j;
4
+ int size;
5
+ char tmp;
6
+ int flag;
7
+
8
+ i = 0;
9
+ size = strlen(s);
10
+ j = size - 1;
11
+ flag = 1;
12
+ while (i < j) {
13
+ if (!isalnum(s[i])) {
14
+ ++i;
15
+ continue ;
16
+ }
17
+ else if (!isalnum(s[j])) {
18
+ --j;
19
20
21
+ if (tolower(s[i++]) != tolower(s[j--])) {
22
+ flag = 0;
23
+ break ;
24
25
26
+ return (flag);
27
+}
0 commit comments