Dynamic palindrome checker in c