We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
But your "problem statement" is really hard to interpret in accordance to idea that you have explained in this forum!
-
In fact, your "problem statement" asserts that:
If N is not a power of 2, they reduce the counter by the largest power of 2 less than N.
Let N be equal to 42 (aka 0b101010).
I'm really sorry to contradict you, but every english-speaking person agree with me that "the largest power of 2 less than 42" is 32 (aka 0b100000)!! Right?
-
Anyway, according to your really badly stated idea, what is "the largest power of 2 less than 42"?
Is it 8 (aka 0b001000)?!
Or is it 2 (aka 0b000010)?!
-
In your opinion, what is the largest power of 2 less than 63 (aka 0b111111)?
32 (aka 0b100000)?!
16 (aka 0b010000)?!
8 (aka 0b001000)?!
4 (aka 0b000100)?!
2 (aka 0b000010)?!
1 (aka 0b000001)?!
-
Would do you improve the "problem statement", please? Thanks!
Sergio
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Counter game
You are viewing a single comment's thread. Return to all comments →
I finally understand what you say!
-
But your "problem statement" is really hard to interpret in accordance to idea that you have explained in this forum!
-
In fact, your "problem statement" asserts that:
Let N be equal to 42 (aka 0b101010).
I'm really sorry to contradict you, but every english-speaking person agree with me that "the largest power of 2 less than 42" is 32 (aka 0b100000)!! Right?
-
Anyway, according to your really badly stated idea, what is "the largest power of 2 less than 42"?
Is it 8 (aka 0b001000)?!
Or is it 2 (aka 0b000010)?!
-
In your opinion, what is the largest power of 2 less than 63 (aka 0b111111)?
32 (aka 0b100000)?!
16 (aka 0b010000)?!
8 (aka 0b001000)?!
4 (aka 0b000100)?!
2 (aka 0b000010)?!
1 (aka 0b000001)?!
-
Would do you improve the "problem statement", please? Thanks!
Sergio