Distinct Power
In the ancient kingdom of warriors, each troop possessed unique magical powers. You are given an array $A$ of $N$ integers where $A_i$ represents the power of the $i^{th}$ troop. All powers in array $A$ are **distinct**. Each troop is assigned a rank based on its power - the troop with the highest power has rank $1$, and the troop with the lowest power has rank $N$. These ranks form array $B$
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.
Sign in to chat with the tutor and save your progress.
Sign in to start