Why there is error ?in one test case
test case1 is nnot accepted it shows wrong answer
hi @gagz23 there’s a very neat trick to this question. If you observe carefully, you have to take steps of 2. The binary representation of the number also consists powers of 2 only. So the answer is actually the number of set bits (number of 1s in the binary representation) in the number. Do try this approach!