Respuesta :
The answer of the array will be:
You should set the <code>maxSubsetSize</code> to <code>1</code> initially. Otherwise, the <code>maxSubsetSize</code> would be bigger than the size of the actual subset.
<code>int size = A.size();
int maxSubsetSize = 1;
int subsetSize = 1;
int andProduct = A[0];
for (int i = 1; i < size; ++i) {
if (andProduct & A[i] == 0) { // if AND product is 0, reset the subset
size
subsetSize = 1;
andProduct = A[i];
} else {
++subsetSize;
andProduct &= A[i];
if (subsetSize > maxSubsetSize) {
maxSubsetSize = subsetSize;
}
}
}
return maxSubsetSize;
</code>
What is array?
An array is a type of data structure used in computer science that contains a set of elements (values and variables), each of which is identified by an array index or key. An array is stored in a way that allows a mathematical formula to determine each element's position given its index tuple. A linear array, sometimes referred to as a one-dimensional array, is the most basic sort of data structure. For instance, ten words with memory addresses 2000, 2004, 2008,..., 2036 (or 0x7D0, 0x7D4, 0x7D8,..., 0x7F4) may be used to store an array with ten 32-bit (4-byte) integer variables with indices 0 through 9. This would give the element with index I the address 2000 + I 4). First address refers to the memory location of the array's first element.
To learn more about array
https://brainly.com/question/28087779
#SPJ4