Longest Palindromic Subsequence — filling the interval table
dp[i][j] = s[i]==s[j] ? dp[i+1][j-1] + 2 : max(dp[i+1][j], dp[i][j-1])
dp[i][j] = longest palindromic subsequence inside the interval i..j. Matching endpoints wrap the inner interval (+2); otherwise drop one end and take the better. Each cell needs the row below and column to the left, so rows fill bottom-up, left to right. Base: the diagonal is 1.
dp — rows: start i · columns: end j (upper triangle)