← All problemsSign in

Sams Transformation

Sam likes transformations and is given a task of transforming one positive integer into an- other positive integer. In order to do so, he is given the starting integer, ending integer and a set S containing N positive integers. At each step, Sam can convert the current integer X to either $\phi(X)$ or $X^{2}$, provided that the new integer belongs to set S. $\phi(X)$ is the number of integers less

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