LeetCode solutions

1626. Can Make Arithmetic Progression From Sequence

My accepted Python solution to LeetCode problem 1626, Can Make Arithmetic Progression From Sequence, running in 3ms.

  • Difficulty: Easy
  • Python
  • Runtime 3ms
  • Memory 17.7MB

Read the problem on LeetCode View on GitHub

Python

Accepted on LeetCode — runtime 3ms, memory 17.7MB, accepted 2025-12-29.

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

Source