Question: A zero - bit array is a non - empty integer array where the bitwise AND of all elements is 0 . For example, 1

A zero-bit array is a non-empty integer array where the bitwise AND of all elements is 0. For example, 1,2 is a zero-bit array since 1&2=0 but 2,3 is not since 2&3=2. Here & denotes the bitwise AND operation.
Given an array arr of nintegers, find the number of zero-bit subarrays of arr.
Note: A subarray is any contiguous segment of the array.
Example
Suppose n=3 and art =[4,5,2].
Here only 5,2 and 4,5,2 are zero-bit subarrays as 5&2=0 and 4&5 & 2=0. Hence, we report 2 as the answer.
Function Description
Complete the function getZeroBitsubarrays in the editor below .
 A zero-bit array is a non-empty integer array where the bitwise

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!