Solve Longest Same Subsequence