2261. K Divisible Elements Subarrays
Given an integer array nums and two integers k and p, return the number of distinct subarrays which have at most k elements divisible by p.
Two arrays nums1 and nums2 are said to be distinct if:
- They are of different lengths, or
- There exists at least one index i where nums1[i] != nums2[i].
A subarray is defined as a non-empty contiguous sequence of elements in an array.
1 | class Solution { |