American Express interview question

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