Google Online Assesment Question

Revision en2, by FifthThread, 2021-07-22 08:26:32

find minimum number of integers, (where each such integer>=2) that divide all array elements. For example, if the array is [2,4,6,8,10] then the answer is 1 (because 2 divides all array elements). Another example, if the array is [2,3,4,9] then the answer is 2 (because we need at least 2 different numbers, 2 and 3, that satisfy the conditions).

Constraints: N<=10^3

Can someone help, I am not able to solve this problem.

Tags #google, #internship

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English FifthThread 2021-07-22 08:26:32 89
en1 English FifthThread 2021-07-22 08:25:33 378 Initial revision (published)