#3209
Number of Subarrays With AND Value of K
hard · 35.1% accepted · 170 likes · top 13%
array · binary search · bit manipulation · segment tree
Description
Given an array of integers nums and an integer k, return the number of subarrays of nums where the bitwise AND of the elements of the subarray equals k.
Solution