Pls explain me the test cases

I am unable to understand the test case when n = 4, 5;
and to me, their result should be 2, 3

Hi @Avi-Kasliwal-315786729062203, in this problem it is mentioned that hulk can only jump in the power of 2 i.e in one jump hulk can jump 1,2,4,8,16,32,64… levels
so now coming to test cases
for n=4
since 4 is already in power of 2 so hulk can jump once covering 4 levels thus ans=1
for n=5
hulk has to jump twice i,e in one jump it crosses 4 levels and in another it crosses 1

In case of any doubt feel free to ask :slight_smile:
mark your doubt as resolved if your query got resolved

can he climb down?
for n = 14, will it be 1 + 6 (1 jump to 8 and then 6 climbs up)
or it will be 3 (get to 16 in 1 jump n then get down 2)?

@Avi-Kasliwal-315786729062203
hello avi,

in first jump he will jump to 8 ( 6 more step left)
then he will take a jump of 4 and reach to 12 ( 2 more steps left)
then he will take a jump of 2 steps and reach to 14 ( 0 steps left).

so total three steps will be there.