← All problemsSign in

TWINS

Akshay is fascinated by anything he considers to be a twin. He calls a pair of positive integers ,i and j, twins if: * They are both prime * There absolute difference is exctly equal to 2(i.e.,|j-i|=2) Given an inclusive interval of integers from n to m, Can you help Akshay to find number of pairs of Twins there are in the interval. Note:-Pairs(i,j) and (j,i) are considered same. Input Two i

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start