← All problemsSign in

Fake Sort

You will be given a sequence A of $N$ distinct integers A1, A2, A3, … AN. Let the new sequence B obtained after sorting the given sequence in ascending order be B1, B2, B3, … BN. Let $P(i)$ be the position of the $ith$ element of sequence B in sequence A. Now, let us define another sequence C of $N$ integers C1, C2, C3, … CN such that, For all ( 1 <= $i$ <= $N$ ) $Ci$ = $Bi$

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