Tap here to switch tabs
Problem
Submissions

Problem: Count Number of Maximum Bitwise-OR Subsets

med
30 min
Try to solve the Count Number of Maximum Bitwise-OR Subsets problem.

Statement

Given an integer array nums, determine the maximum possible bitwise OR value of any of its subsets. Return the number of non empty subsets that yield this maximum bitwise OR value.

An array a is a subset of an array b if a can be obtained from b by deleting some (possibly zero) elements of b. Two subsets are considered distinct if they are formed by choosing elements from different indices of nums.

Constraints:

  • 1≤1 \leq nums.length ≤16\leq 16

  • 1≤1 \leq nums[i] ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Number of Maximum Bitwise-OR Subsets

med
30 min
Try to solve the Count Number of Maximum Bitwise-OR Subsets problem.

Statement

Given an integer array nums, determine the maximum possible bitwise OR value of any of its subsets. Return the number of non empty subsets that yield this maximum bitwise OR value.

An array a is a subset of an array b if a can be obtained from b by deleting some (possibly zero) elements of b. Two subsets are considered distinct if they are formed by choosing elements from different indices of nums.

Constraints:

  • 1≤1 \leq nums.length ≤16\leq 16

  • 1≤1 \leq nums[i] ≤105\leq 10^5