Company: keysight
Difficulty: medium
Super Bit Strings You are given an integer n and an array bitStrings of m integers. Each integer represents a binary string of length exactly n : the string is the n -bit binary expansion of that integer, padded on the left with 0 s where necessary. A super bit string of a given bit string is any string obtained by changing any number of its 0 s into 1 s. A 1 can never be changed back into a 0 , and changing nothing at all is allowed, so every bit string is a super bit string of itself. Count the distinct binary strings of length n that are a super bit string of at least one of the given bit strings. Strings produced from different entries of bitStrings are counted only once. Function Description Complete the function countSuperBitStrings in the editor below. countSuperBitStrings has the following parameters: int n : the length of every binary string int bitStrings[m] : the given bit strings, each encoded as an integer in [0, 2^n) Returns int : the number of distinct super bit strings