← All problemsSign in

Chef and the Unique Number

Chef was getting bored sitting idle, he asked his friend to give him some problem to solve. His friend gave him a simple question as she doesn't want him to waste much time. His friend will guess a random number n chef has to find a nearest unique pair to the left and right of n. A pair is called unique pair if both the numbers in a pair are prime and the absolute difference between them is 2. C

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