Tap here to switch tabs
Problem
Submissions

Problem: Count Number of Maximum Bitwise-OR Subsets

Count Number of Maximum Bitwise-OR Subsets asks you to find the greatest bitwise OR of a non-empty subset of an integer array and return how many index-based subsets produce that value.

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

Count Number of Maximum Bitwise-OR Subsets asks you to find the greatest bitwise OR of a non-empty subset of an integer array and return how many index-based subsets produce that value.

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