input: from typing import List
  import bisect
  def subarrays_with_and_k(nums: List[int], k: int) -> int:
      """
      Given an array of integers nums and an integer k, determine the count of
      subarrays in nums where the bitwise AND of the subarray's elements equals k.
  
      Examples:
      >>> nums = [1,1,1], k = 1
      6
      >>> nums = [1,1,2], k = 1
      3
  
      Constraints:
      1 <= nums.length <= 10^5
      0 <= nums[i], k <= 10^9
      """
output:     count = 0
      for i in range(len(nums)):
          current_and = nums[i]
          if current_and == k:
              count += 1
          for j in range(i + 1, len(nums)):
              current_and &= nums[j]
              if current_and == k:
                  count += 1
              elif current_and < k:
                  break
      return count