LeetCode-1502/220325


https://leetcode.com/problems/can-make-arithmetic-progression-from-sequence/

Python

class Solution:
    def canMakeArithmeticProgression(self, arr: List[int]) -> bool:
    	s = sorted(arr)
        d = s[0] - s[1]
        for i in range (2, len(s)):
        	if d != s[i-1] - s[i]:
            	return False 
        return True