Definition: In this task, you are given two lists A,B. Find the longest common subsequence in the lists A and B.
Input: [7877, 8951, 8897, 6039, 819, 'L', 2919, 9849, 'L', 1513, 'y', 7441, 8367, '4989', 'F', '1951', '127', 'Z', '5009', 'P', '5837', 'I', '8225', '4801', '1301', 'K', 'R', 'c', 'H', 'C', 'e', 'h', 10031, 1905, 'V', 5485, 'i', 'K', 7239, 6199, 9979, 'z', 6917, 'J'], [7621, 'n', 7387, 4195, 3979, 'F', 3677, '4989', 'F', '1951', '127', 'Z', '5009', 'P', '5837', 'I', '8225', '4801', '1301', 'K', 'R', 'c', 'H', 'x', 'g', 4339, 'a']
Output:
4989, F, 1951, 127, Z, 5009, P, 5837, I, 8225, 4801, 1301, K, R, c, H