Infosys Interview Question

pallindrome logic