Can Make Arithmetic Progression
An arithmetic progression is a list where the difference between every two neighbouring items is the same. Return True if the items of arr can be reordered to form one, otherwise False.
Example 1
arr [3,5,1]
returns true
Reorder to 1, 3, 5: difference 2 each time.
Example 2
arr [1,2,4]
returns false
No order has equal gaps.
Constraints
2 <= len(arr) <= 7-20 <= arr[i] <= 20
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.