← All problemsSign in

Make It Indivisible

Your Math teacher has given you $N$ numbers(from 1 to $N$) and he wants you to arrange them according to his rule. It’s a very simple rule, he wants you to arrange them in such a way that from 2nd index to $Nth$ index, the index should not divide the number. In simple words assuming your arrangement array is $R$, from $2 \leq i \leq N$ (1-indexing) $i$ should no divide $R[i]$ ### Input - Single l

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