← All problemsSign in

Jealous Numbers

Little Alice likes to play with her collection of N integers. She knows her collection very well, and often likes to come up with different observations about the numbers. For example, Alice had recently learned that two numbers can be jealous of each other in case they have a non-trivial common divisor (i.e. greater than one divisor). For example, the numbers 8 and 12 are jealous of each other,

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