first, second and third, each sorted in strictly increasing order.
Return an increasing array of the numbers that appear in all three arrays.
Counting everything in a dictionary is easy; try to use no extra memory by taking advantage of the arrays being sorted.first=[2, 4, 6, 8], second=[1, 2, 3, 6, 9], third=[2, 5, 6, 7] → [2, 6]
Only 2 and 6 appear in all three arrays.
first=[10, 20], second=[10, 30], third=[20, 30] → []
Each number appears in only two of the three arrays, so the answer is empty.
first), len(second), len(third) ≤ 1000first=[2, 4, 6, 8], second=[1, 2, 3, 6, 9], third=[2, 5, 6, 7]
[2, 6]
Run checks the first 3 tests in your browser. Submit checks all 82 tests on the server, hidden ones included.