Given an integer array nums and two integers k and p, return the number of distinct subarrays that contain at most k elements divisible by p.
A subarray is a contiguous sequence of elements within an array.
Note: Two subarrays are considered distinct if they have different lengths or contain different elements at corresponding positions.
Constraints:
nums.length
nums[i], p
k nums.length
Given an integer array nums and two integers k and p, return the number of distinct subarrays that contain at most k elements divisible by p.
A subarray is a contiguous sequence of elements within an array.
Note: Two subarrays are considered distinct if they have different lengths or contain different elements at corresponding positions.
Constraints:
nums.length
nums[i], p
k nums.length