#include <stdio.h>
#include <ctype.h>
#include <stdbool.h>
#include <string.h>
bool isSentencePalindrome(const char* str) {
// Convert the string to lowercase and remove non-alphanumeric characters
char cleanedStr[1024];
int j = 0;
for (int i = 0; str[i]; i++) {
if (isalnum(str[i])) {
cleanedStr[j++] = tolower(str[i]);
}
}
cleanedStr[j] = '\0';
// Check if the cleaned string is a palindrome
int len = strlen(cleanedStr);
for (int i = 0; i < len / 2; i++) {
if (cleanedStr[i] != cleanedStr[len - i - 1]) {
return false;
}
}
return true;
}
int main() {
const char* sentence = "Top step's pup's pet spot.";
printf("%s\n", isSentencePalindrome(sentence) ? "yes" : "no");
return 0;
}
/*
run:
yes
*/