Pradyumna interview question

Write a block for palindrome.