Miser on date again
CodeChefOpen on judge ↗
After a flop date, Amit decided to go on another date and this time he will purchase many gifts. **Cost of each gift is 100 coins**. But he is running short of money again. So he went to a gift shop. There are $N$ gifts of different types $g1,g2,g3...,gN$ arranged on the table in a sequence. To save cost Amit will choose **adjacent gifts of same type $g[i]=g[i+1]$** and replace them with a gif
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