Tap here to switch tabs
Problem
Submissions

Problem: Number of Subarrays With AND Value of K

Try to solve the Number of Subarrays With AND Value of K problem.

Statement

Given an array of integers nums and an integer k, return the number of contiguous subarrays where the bitwise AND of all elements in the subarray equals k.

Note: A subarray is a contiguous non empty sequence of elements within an array.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 0≤0 \leq nums[i], k ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Number of Subarrays With AND Value of K

Try to solve the Number of Subarrays With AND Value of K problem.

Statement

Given an array of integers nums and an integer k, return the number of contiguous subarrays where the bitwise AND of all elements in the subarray equals k.

Note: A subarray is a contiguous non empty sequence of elements within an array.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 0≤0 \leq nums[i], k ≤109\leq 10^9