← All problemsSign in

Hungry Sam!

Sam is working this entire day so he is very hungry now. Sam wants food as soon as possible. But there is problem, the food is available at a shop which is n steps above the level where Sam is standing. Sam can take jumps in power of 2 in order to get food as quickly as possible. Help Sam to reach the Nth step as fast as possible. INPUT First line of input contains an integer t denoting the num

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