Amazon Interview Question

to find Longest Palindromic subsequence and print it