Given an array a (0 <= a[i] <= 2^22) of length N(<=1e5). For every i, you need to find the number of j such that a[i]&a[j] = a[j].
Given an array a (0 <= a[i] <= 2^22) of length N(<=1e5). For every i, you need to find the number of j such that a[i]&a[j] = a[j].
Can someone explain how to solve this and if you know similar problems, can you please mention them here?
I know trie concept but not able to come up with a solution.
(Please don't down vote until some one posted the solution. I don't want it to disappear from recent actions without being answered.)