Amazon OA Questions || Help needed
Anonymous User
1740

Amazon OA Questions || Intern Openings

Write a program to count the number of array elements in the range [L,R] which divides all numbers in the range [L,R].

Sample testcases
Input 1
5
2 4 8 64 16
1 4
Output 1
1
Input 2
6
4 2 4 2 4 2
1 6
Output 2
3

Anyone please help me out i was not able to paas all the test cases.

Code constraints
0 < = L < = R < = N

Output format
Displays the number of elements that divide (with remainder 0) all elements in the range L to R

Comments (4)