← All problemsSign in

Buildings

Our hero, Popeye is caught in a fix when he goes to visit some new buildings that his rival company is constructing. The strangest part about each building is that to he needs to pay 1 rupee to get into each building and 1 rupee again to get out of the building. However, the surprises don't end there. Inside the building, all of his money instatntly doubles up. The trick for you, the programmer is

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