All the TCs giving run error ! in Query Bits problem

my sol : https://ide.codingblocks.com/s/253426

i am not able to understand why the TCs are giving run error!.

According to me it’s not due to the sizes of the arr as the code is running fine on my ide as well as the sample test case gives correct ans

Pls help me out

Hi @saarthakseth
i see that there is some issue probably with the test case, or i dont know why the code looks perfectly fine
i`ll revert back as soon as i get the correct code, ( i have asked for help)

here is the correct code

but what is the problem in my code ?? can u pls tell me as i think my code should work too

probably because of size of array u are making
here it is multipplied by 2
and then all calculations are done

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.