Not passing test cases

Sample Input

2 1 1 10 15

Sample Output

1 17

Your o/p:
1

How to correct it sir

Your approach is not correct.
According to the question
Your task is to count the no of set-bits in for all numbers between a and b.
But you are just counting the number of setbits in n. Dry run with the sample test case and check.

You can refer this code https://ide.codingblocks.com/s/303685

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.