Sysvine Technologies Interview Question

Write a code on palindrome explain the logic