1502. Can Make Arithmetic Progression From Sequence
Easy
A sequence of numbers is called an arithmetic progression if the difference between any two consecutive elements is the same.
Given an array of numbers arr
, return true
if the array can be rearranged to form an arithmetic progression. Otherwise, return false
.
Example 1:
Example 2:
Constraints:
2 <= arr.length <= 1000
-106 <= arr[i] <= 106
解題
Runtime: 0 ms, faster than 100.00%
Memory Usage: 2.5 MB, less than 88.89%
Last updated