values. Can its elements be rearranged so that the difference between every pair of neighbours is the same?
Return True if such an arrangement exists and False otherwise.values=[11, 2, 8, 5] → True
Ordered as [2, 5, 8, 11], every step is 3.
values=[1, 4, 6] → False
In any order the gaps differ: 3 and 2.
values=[7, 7, 7] → True
A step of 0 counts too.
values=[11, 2, 8, 5]
True
Run checks the first 3 tests in your browser. Submit checks all 159 tests on the server, hidden ones included.