← All problemsSign in

Power of 2

You are given a number X. You have to tell the count of number that are power of two. If a number is in the power of two, check for that number as well. Let X=2, we know 2 is a power of 2 and its power is 1. 1is also a power of 2 and its power is 0. So 1 is the only number which can be represented as a power of 2(2^1=2) and it is also in the power of 2(2^0=1). Note: Here we don't consider 2. ##

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