← All problemsSign in

Helping Hands

Tango Charlie and his friends are preparing for their online end-semester examination. Tango and his friends are very helpful and always try to teach each other. Here comes the twist, you live in the Star Trek world and can transfer knowledge instantaneously. There are $N$ friends including Tango Charlie. $i-th(1<=i<=N)$ friend has a knowledge level of $K_i = i$. In **one second** any two of t

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