Tap here to switch tabs
Problem
Submissions

Problem: Can Make Arithmetic Progression From Sequence

med
30 min
Try to solve the Can Make Arithmetic Progression From Sequence problem.

Statement

A sequence of numbers is called an arithmetic progression if the difference between any two consecutive elements is constant.

Given an array of numbers arr, return true if the array can be rearranged to form an arithmetic progression, and false otherwise.

Constraints:

  • 2≤2 \leq arr.length ≤1000\leq 1000

  • −106≤-10^6 \leq arr[i] ≤106\leq 10^6

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Can Make Arithmetic Progression From Sequence

med
30 min
Try to solve the Can Make Arithmetic Progression From Sequence problem.

Statement

A sequence of numbers is called an arithmetic progression if the difference between any two consecutive elements is constant.

Given an array of numbers arr, return true if the array can be rearranged to form an arithmetic progression, and false otherwise.

Constraints:

  • 2≤2 \leq arr.length ≤1000\leq 1000

  • −106≤-10^6 \leq arr[i] ≤106\leq 10^6