Program to find longest palindromic subsequence