Difficulty in understanding the problem

It states that I have to count numbers divisible by prime numbers which are below 20 in the range(1,n]

In sample test cases it has given 4 numbers divisible by those prime numbers in range 1 to 5.
there are only 2 numbers (2 and 3 which are eligible).
Also in second test case in range 1 to 10. there are only 4 numbers (2,3,5,7) but answer is 9.
I am not able to understand the problem.

You are interpreting the question in a wrong way. It says that you have to give the count of numbers from 1 to N which are divisible by prime numbers below 20 i.e by {2,3,5,7,11,13,17,19}.
As per the sample test case for N = 5,
2, 4 are divisible by 2
3 is divisible by 3
5 is divisible by 5
And here count is 4.

For N=10.
Numbers from 1 to 10.

2,4,6,8,10 are divisible by 2 --> count is 5
3,6,9 is divisible by 3 --> count is now 5+3 =8
5,10 is divisible by 5 --> count is now 8+2 = 10
7 is divisible by 7 --> count is now 10 + 1= 11.

But the answer is 9 because 6,10 comes twice so we have to subtract that. Hence the answer left is
11 - 2 = 9.