Domanda di colloquio di American Express

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