RosettaCodeData/Task/Palindrome-detection/C/palindrome-detection-3.c
2023-07-01 13:44:08 -04:00

6 lines
155 B
C

int palindrome_r(const char *s, int b, int e)
{
if ( (e - 1) <= b ) return 1;
if ( s[b] != s[e-1] ) return 0;
return palindrome_r(s, b+1, e-1);
}