Can Make Arithmetic Progression From Sequence LeetCode solution in Python

1
class Solution:
2
def canMakeArithmeticProgression(self, arr: List[int]) -> bool:
3
arr.sort()
4
check = arr[0] - arr[1]
5
for i in range(len(arr) - 1):
6
if arr[i] - arr[i + 1] != check:
7
return False
8
return True

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0