Can You Count the Bit Strings?
A bit string is a string of bits that have values of either 1 or 0, A super bit string is a bit string made by flipping zero or more of the 0s in the bit string to 1.
Given k decimal integers, convert each to a bit string that has a given length n. Generate all possible super bitstrings of each of the k bit strings. Finally, perform a union of the super bit strings of all the bit strings and determine its size. This is the number to return.
Complete the function superBitstrings in the editor.
superBitstrings has the following parameters:
- 1.
n: the required bit string length - 2.
int[] bitStrings: an array of decimal integers
Returns
int: the number of unique bitstrings that can be formed from all k values provided.
1Example 1
Constraints
Limits and guarantees your solution can rely on.
🍑🍑