Dynamic Programming, Facebook Coding Interview, Google Coding Interview, Coding Interviews, Java.
Input String s Dp state dp[i][j] represents longest palindromic subsequence's length of substring(i, j), here i, j represent left, right indexes in the string dp[i][i] = 1 // single character palindrome Run matrix loop diagonally because dp[i][j] depends in dp[i+1][j-1] len = 1 to s.length i = 0 to