mirror of
https://github.com/lWolvesl/leetcode.git
synced 2026-01-13 02:38:37 +08:00
init
This commit is contained in:
14
we/24-sy-1.c
Normal file
14
we/24-sy-1.c
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
bool isPalindrome(char *s){
|
||||
int len = strlen(s);
|
||||
int left = 0, right = len - 1;
|
||||
while (left < right) {
|
||||
if (s[left] != s[right]) {
|
||||
return false;
|
||||
}
|
||||
left++;
|
||||
right--;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user