← All problemsSign in

Lucky Numbers

Chef's Lucky Numbers are 2 and 7. He is preparing a dish and he wants to use some specific ingredients only. A particular ingredient is represented by a number N. Chef will select the ingredient if and only if N has exactly 2 factors as 7. That is, if N is represented as N = 7^p * M, (where ^ represents exponentiation), Then chef will select the ingredient if and only if p is 2. Given the in

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