the solution seems perfect, with all the relevant long datatypes, working for the given inputs.
it’s a pretty direct solution, using combinatorics, 2^(n)-1=x all the possible cases for one column (of nXm grid of 0’s and 1’s), to have atleast one “0” in it…that bitwise AND for that place(column) can be zero…there are m columns…so total possibilities is x^m.

i thought of all the cases and everything, still it gives wrong answer…its the most direct and simplest solution.

do help ,if anyone has any idea regarding this…thanks

the value i convert from double to integer, is a natural no. only no?..so its value should not change after conversion to integer.
i ran the give ques- inputs also through this code, and got the relevant outputs.
i think its creating problems for some very heavy numbers, but idk why.

yes…understood.
but there should be no numbers after the decimal point no?..just zeros…so truncating should not be a problem right?..since its a natural number only

yea i got ur point…when i saw the answers , everyone had used that binary exponentiation method only, that u suggested…so i guess learning and using that should be the way ahead.
was stuck on this for a long time…thanks alot for help…much appreciated <3