items of even length. Distribute all of its elements into two groups of equal size (len(items) / 2 elements each) so that within each group all numbers are distinct.
Return True if this is possible and False otherwise.items=[3, 7, 3, 9] → True
For example [3, 7] and [3, 9]: each half holds distinct numbers.
items=[5, 5, 2, 5] → False
There are three 5s but only two halves, so one half is bound to get two of them.
items=[8, 8] → True
items=[3, 7, 3, 9]
True
Run checks the first 3 tests in your browser. Submit checks all 107 tests on the server, hidden ones included.