Problem 3. Longest palindromic sub-sequence. Consider sequence of characters $a_1, a_2, \dots, a_n$ such
that $a_i \in \{A, C, G, T\}$ for all $i$. A sub-sequence is any subset of these numbers taken in order, of the form
$a_{i_1}, a_{i_2}, \dots, a_{i_k}$ where $1 \le i_1 < i_2 < \dots < i_k \le n$, and an palindromic sub-sequence is one which is the same
whether read left to right or right to left. For instance, the sequence A, C, G, T, G, T, C, A, A, A, A, T,
C, G has many palindromic sub-sequences, including A, C, G, C, A and A, A, A, A (on the other hand, the
sub-sequence A, C, T is not palindromic). The goal is to find length of the longest palindromic sub-sequence.
(a) Define OPT(i, j) to be the length of the longest palindromic sub-sequence of the sequence $a_1, a_2, \dots, a_j$.
Write a recurrence and base case for OPT(i, j).
(b) Write the pseudo-code for a bottom-up dynamic programming algorithm that runs in $O(n^2)$ time.