Freedom Fighter
CodeChefOpen on judge ↗
In a cold war, the last freedom fighter is left and wants to kill as many enemies as he can in order to free his country. There are $N$ enemies and the power of $i^{th}$ enemy is $A_i$ and the freedom fighter having power $P$. When the freedom fighter having power $P$ attacks an enemy of power $A_i$ the power of freedom fighter decreases by $A_i$. The freedom fighter can kill an enemy if and onl
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