This question was asked today in TNQT Digital 2 Exam

Find how many Sexy Prime Numbers in a given range n and m.

Constraint: 2 <= n < m <= 1000,000,000.

Sample Input:

4 40

Output:

7

Explanation:

[5,11]

[7,13]

[11,17]

[13,19]

[17,23]

[23,29]

[31,37]

How to solve this for given constraint?