leetle

Daily challenge for 2025-06-22

173. Check if Array is Arithmetic Progression

Write a function solve that checks if an array can be rearranged to form an arithmetic progression. An arithmetic progression is a sequence where the difference between consecutive terms is constant.

Example:
Input: [3, 5, 1]
Output: true (can be arranged as [1, 3, 5] with difference 2)

Example 2:
Input: [1, 2, 4]
Output: false

Run this challenge interactively in Python or JavaScript when the app loads.