2020 第 28 周 LeetCode 记录

Yiran at 
1502. Can Make Arithmetic Progression From Sequence 判断是否可以组成等差数列,将数组排序后,比较两两数字差是否一致。123456789101112class Solution: def canMakeArithmeticProgression(self, arr: List[int]) -> bool: if len(arr) == 2: return True arr.sort(reverse=True) diff = arr[0] - arr[1] pre……