Number of Subarrays with Or less than K

Sliding Window / 2 Pointer Contest Hard

Given an integer array nums and an integer k, return the number of subarrays whose bitwise OR of elements is less than or equal to k.

Constraints

  • 1 <= nums.length <= 104
  • 0 <= nums[i] <= 104
  • 0 <= k <= 104

Company Tags

[ ]