Driver code
let set1 = [ 1 , 3 , 9 , 27 , 81 , 243 ] ; let n1 = set1 . length ; document . write ( lenOfLongestGP ( set1 , n1 ) + " " ) ; let set2 = [ 1 , 3 , 4 , 9 , 7 , 27 ] ; let n2 = set2 . length ; document . write ( lenOfLongestGP ( set2 , n2 ) + " " ) ; let set3 = [ 2 , 3 , 5 , 7 , 11 , 13 ] ; let n3 = set3 . length ; document . write ( lenOfLongestGP ( set3 , n3 ) + " " ) ;