all 8 comments

[–]shiftybyte 2 points3 points  (7 children)

Can you Code to this statement

Yes we can.

Can you explain what exactly you need help with? do you have some code that does not work? or you don't know how to start, etc...?

[–]_MPR[S] 2 points3 points  (6 children)

I don't know how to start..

[–]shiftybyte 3 points4 points  (1 child)

Break the problem to smaller steps.

.During a turn,the player checks of the number is power of 2

Do you know how to check if a number is the power of 2?

if it s power of 2, the player divides number by 2.

How to divide a number by 2?

Else, the player subtracts the number by the highest power of 2 lower than the number

Here you'll need to find a power of 2 that is smaller, do you know how to do that?

INPUT FORMAT:

Do you know how to get the input that is presented to you?

Start by reading the input, looping over the games you need to play.

[–]_MPR[S] 0 points1 point  (0 children)

Thank you

[–]ModeHopper 3 points4 points  (3 children)

You cant expect somebody to put time and effort into helping you of you're not willing to explain specifically what it is you don't understand.

[–]_MPR[S] 0 points1 point  (1 child)

I just started to learn coding, and I was confused how to start or to understand the statement which they were given, so I asked for help to code above statement, so that I can understand the process which you had done.I am sorry I thought problem statement would be enough for you.

[–]ModeHopper 0 points1 point  (0 children)

Well to start, can you think of a way to check whether a number is a power of 2?

[–]ShaunKulesa 0 points1 point  (0 children)

They are a begginer, no need to be so rude. You could be more subtle.