left and right. Return every distinct value that occurs in both left and right.
Each value must appear in the answer exactly once, no matter how often it repeats in the lists. The answer may be in any order.left=[3, 8, 8, 1], right=[8, 5, 3, 8] → [8, 3]
The shared values are 3 and 8. The 8 appears several times but is listed once; [8, 3] is accepted too.
left=[0, 2], right=[4, 6, 1] → []
There are no shared values.
left), len(right) ≤ 1000left=[3, 8, 8, 1], right=[8, 5, 3, 8]
[8, 3]
Run checks the first 3 tests in your browser. Submit checks all 122 tests on the server, hidden ones included.