Just Check Other’s codes if you are not able to come up with a solution.Why do you need us to solve it?
Other people’s code tends to be utterly undecipherable and usually gives no clue as to the high-level approach/ logic behind it - which is why Problems should always have an Editorial
input a [n]&b
find number of occurences of each value ans store in int occur
convert b to binary
as bool b;
regardless then add occur[i]C2 to occur[i+1]
take mod at all steps to prevent overflow;
ans=ansoccur[i] because thats how many ways we can choose that power
we add occur[i]C2 because any pair can also be used to get the same sum.