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
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
Python
Accepted on LeetCode — runtime 3ms, memory 17.7MB, accepted 2025-12-29.
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