Driver program
let set1 = [ 1 , 7 , 10 , 13 , 14 , 19 ] ; let n1 = set1 . length ; document . write ( lenghtOfLongestAP ( set1 , n1 ) + " " ) ; let set2 = [ 1 , 7 , 10 , 15 , 27 , 29 ] ; let n2 = set2 . length ; document . write ( lenghtOfLongestAP ( set2 , n2 ) + " " ) ; let set3 = [ 2 , 4 , 6 , 8 , 10 ] ; let n3 = set3 . length ; document . write ( lenghtOfLongestAP ( set3 , n3 ) + " " ) ;