# 1502. Can Make Arithmetic Progression From Sequence ###### tags: `Python`,`Leetcode` https://leetcode.com/problems/can-make-arithmetic-progression-from-sequence/description/ ## Code ```python= class Solution: def canMakeArithmeticProgression(self, arr: List[int]) -> bool: arr.sort() step = arr[1] - arr[0] for i in range(0, len(arr)-1, 1): if i + 1 >= len(arr): return else : if arr[i+1] - arr[i] == step: if i+1 == len(arr) -1 : return True else: continue else : return ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up