Skip to content

Files

Latest commit

 Cannot retrieve latest commit at this time.

History

History

Longest Arithmetic Progression

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Given a set of numbers, find the Length of the Longest Arithmetic Progression in it.

set[] = {1, 7, 10, 15, 27, 29}
output = 3
The longest arithmetic progression is {1, 15, 29}

set[] = {5, 10, 15, 20, 25, 30}
output = 6
The whole set is in AP