values of even length. Can its elements be reordered so that they split into adjacent pairs where the second number is exactly twice the first? Formally, values[2i + 1] == 2 · values[2i] must hold for every 0 ≤ i < len(values) / 2.
Return True if such an order exists, and False otherwise.values=[6, -2, 3, -4] → True
Pairs (3, 6) and (-2, -4), for example in the order [3, 6, -2, -4].
values=[1, 2, 2, 8] → False
8 would need a 4 or a 16, and neither is present.
values=[0, 5, 0, 10] → True
len(values) is evenvalues=[6, -2, 3, -4]
True
Run checks the first 3 tests in your browser. Submit checks all 115 tests on the server, hidden ones included.