Definition: In this task, you are given two lists A,B. Find the longest common subsequence in the lists A and B.
Input: [5527, 4107, 3699, 'A', 7517, 'P', 5435, 1667, 'P', '4339', '9509', '21', '4415', 'i', '7021', 'n', 'f', 4145, 83, 8803, 4219], [9215, 5539, 8671, 'h', 5327, 'P', '4339', '9509', '21', '4415', 'i', '7021', 'n', 'a', 'm', 'h', 'd']
Output:
P, 4339, 9509, 21, 4415, i, 7021, n