23.06.06 Today’s Leetcode
1502. Can Make Arithmetic Progression From Sequence (easy)
class Solution:
def canMakeArithmeticProgression(self, arr: List[int]) -> bool:
arr = sorted(arr)
n = len(arr)
temp = arr[1] - arr[0]
for i in range(n - 1):
if arr[i + 1] - arr[i] != temp:
return False
return True