Twin Primes
CodeChefOpen on judge ↗
Da Vinci is out in search for the vault of Heaven which is believed to have the Book of Leaves which contains knowledge and power beyond mankind’s reach. To do so he has to overcome many challenges and one such challenge is find all the twin primes below a given number. Modify the given code in order to do so. Twin primes are prime numbers whose difference is 2. For example 3,5;5,7;11,13;17,19,et
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.
Sign in to chat with the tutor and save your progress.
Sign in to start