There is an array A made of N integers. Your task is to choose as many integers
Fantastic news! We've Found the answer you've been seeking!
Question:
- There is an array A made of N integers. Your task is to choose as many integers from A as possible so that, when they are put in ascending order, all of the differences between all pairs of consecutive integers are equal. For example, for A = [4, 3, 5, 1, 4, 4], you could choose 1, 3, and 5 (with differences equal to 2) or 4, 4, and 4 (with differences equal to 0).
- What is the maximum number of integers that can be chosen? Write a function.
Related Book For
Smith and Roberson Business Law
ISBN: 978-0538473637
15th Edition
Authors: Richard A. Mann, Barry S. Roberts
Posted Date: