basics · beginner · ~15 min
Compare characters with two converging pointers.
Implement int is_palindrome(const char *s) returning 1 if s reads the same forwards and backwards, else 0.
#include <string.h>
int is_palindrome(const char *s) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.