The longest common subsequence problem is to find the longest (non-contiguous) sequence of characters shared by two strings X = T2T3...Tn and Y = y1y2...ym. For example, if X = CAB and Y = BACB, the answer is 2 (they both share length 2 subsequences AB and CB). Here, we define a sub-problem C(i,j) to be the longest subsequence of T2...Ti and y1...yj. The recurrence we have seen for C is:
C(i,j) = 1 + C(i-1,j-1) if i>0 and j>0 and T[i] = y[j]
C(i,j) = max(C(i-1,j), C(i,j-1)) if i>0 and j>0 and T[i] ≠y[j]
Use the recurrence to fill in a table for C for the strings X = PEQNP and Y = PQPN. You may use (or not) the sketch below.