Sysvine Technologies interview question

Write a code on palindrome explain the logic