Count Max Bitwise-OR Subsets

Find the maximum possible bitwise OR value that can be achieved by OR-ing any subset of the given array. Then count how many distinct subsets achieve this maximum OR. A subset can be any non-empty selection of elements.

Examples
Input: [3,1]
Output: 2
Hints

Count Max Bitwise-OR Subsets

Find the maximum possible bitwise OR value that can be achieved by OR-ing any subset of the given array. Then count how many distinct subsets achieve this maximum OR. A subset can be any non-empty selection of elements.