Part 1. Definition
In this task, you are given two lists A,B. Find the longest common subsequence in the lists A and B.
Part 2. Example
[5797, 8817, '8297', 'b', 'U', 'b'], [5843, 8809, '8297', 'b', 'W', 'C']
Answer: 8297, b
Explanation: Here, '8297, b' is the longest common subsequence in both the input lists [5797, 8817, '8297', 'b', 'U', 'b'] and [5843, 8809, '8297', 'b', 'W', 'C'].
Part 3. Exercise
['Z', 4791, 9505, 'e', 4999, 'U', 4427, 655, 1593, 2159, 2181, 7989, 'R', 7009, 'b', 'c', 'A', 'h', 'D', '4721', '5955', 'J', '5561', 'S', '4421', 'f', '9463', '4419', '5841', 'C', 'S', 'd', 'b', 'W', 'n', 5273, 'm', 1141, 'm', 'V', 'd', 'n', 'x', 6423, 3907, 7329, 'D', 1227], [7425, 5395, 'Q', 4661, 3479, 2465, 7545, 'Y', 'F', 'h', 'F', 6629, 'A', 'h', 'D', '4721', '5955', 'J', '5561', 'S', '4421', 'f', '9463', '4419', '5841', 'C', 'S', 'd', 'b', 'r', 9317, 'M', 'X', 'n', 1211, 'G', 'z', 3989, 7035, 'f', 'U', 'g', 7487, 'P', 5955, 'X']
Answer:
A, h, D, 4721, 5955, J, 5561, S, 4421, f, 9463, 4419, 5841, C, S, d, b