Check if a string "level" is a palindrome.
MediumProblem Statement
Check if a string "level" is a palindrome.
Sample Input
level
Sample Output
level is a palindrome
Limits
Time: 2s · Memory: 256 MB
Code Editor
00:00
#include <stdio.h>
#include <string.h>
int isPalindrome(char str[]) {
// Your code here
}
int main() {
char str[] = "level";
if (isPalindrome(str)) {
printf("%s is a palindrome\n", str);
} else {
printf("%s is not a palindrome\n", str);
}
return 0;
}
Input
level
Expected Output
level is a palindrome