← All problemsSign in

Coin Game

Abhishek and Sudhanshu were bored and decided to play a game. They only had some coins so they arranged all the '$N$' coins in a straight line with random face up(heads or tails). Abhishek asked Sudhanshu to flip coins in such a manner that all heads faces are up. But he also restricted the method of flipping as ,"If u flip a coin at '$k$'th position, then all the coins after '$k$' must also be f

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