left and right. Compute two numbers:
- how many elements of left (repeats counted) occur somewhere in right;
- how many elements of right (repeats counted) occur somewhere in left.
Return them as a pair [first, second].left=[4, 7, 4, 1], right=[4, 9, 7] → [3, 2]
In left, the elements 4, 7 and 4 also occur in right: that is 3. In right, 4 and 7 occur in left: that is 2.
left=[2, 2], right=[2, 2, 2] → [2, 3]
Every element of each list occurs in the other one.
left=[1, 3], right=[5] → [0, 0]
left=[4, 7, 4, 1], right=[4, 9, 7]
[3, 2]
Run checks the first 3 tests in your browser. Submit checks all 104 tests on the server, hidden ones included.