A sequence is good if the bitwise AND of all its elements is a perfect square.
So counting number of "good" sequences, in a subarray .
For example : in [1, 2, 3]
There are 6 sub-sequences:
So there are 3 "good" sequences
Can you suggest an efficient approach to count them ?