a b c d a f a c b c f If(input[i]==input[j]) t[i][j]=t[i-1][j-1]+1; else T[i][j]=max(T[i-1][j],T[i][j-1]);