Playing with bits

do we need to do precomputing of setbits because there is range of queries being asked?

hello @guptashubham210a

if u want then u can do that it will make ur program faster.

btw simply brute approach will aslo work

I havr precomputed sum but inot gettinig correct answer

getting segmentation fault.

not getting output pls chcek my code.

hello @guptashubham210a
actually the range of numbers is not know to us.
so dont use precomputation.
use brute force only

you mean if in constraints it would given limits then we should have done precomputation?
pl tell me my code of precomputation was correct ?

yeah ur precomputation logic is correct.

yeah that is what i mean to say

1 Like

ok thanks,I have doubt in one question but no reply came till now

ping that TA who is taking ur doubt

or create a new thread by raising a different doubt

max
XOR profit problem