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
[5373, 'Y', '6295', '9703', 'i', 'r', '9677', 'w', '2963', 'V', '251', 'S', 'Q', 'H', 'Y', '5357', '6369', 'Q', 'J', 'H', '1151', 'f', '5355', 'o', 'N', 9139, 4625, 'P', 9503, 'K', 'V', 's', 'Q', 'R', 1479, 3855, 'P', 'g', 'K', 'g', 4183, 1531, 'k'], [1523, 'J', 3777, 3755, 6461, 4975, 8483, 5907, 6795, 2357, 'r', 1443, 1655, 'z', 'n', 'y', '6295', '9703', 'i', 'r', '9677', 'w', '2963', 'V', '251', 'S', 'Q', 'H', 'Y', '5357', '6369', 'Q', 'J', 'H', '1151', 'f', '5355', 'o', 'n', 4753, 3191, 8973, 's', 6325, 3453, 1947, 7485, 'j', 'x', 5613, 'r', 'q', 3017, 'I', 'X', 'i', 'I', 10007, 'M']
Answer:
6295, 9703, i, r, 9677, w, 2963, V, 251, S, Q, H, Y, 5357, 6369, Q, J, H, 1151, f, 5355, o