Pergunta de entrevista da empresa American Express

Solve this problem for palindrome. Solve this question for 2 sum