simple sol using set
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
    int countDistinct(vector<int>& nums, int k, int p) {
        int n=nums.size();
        set<vector<int>>ans;
         
        vector<int>temp;
        for(int i=0;i<n;i++){
            temp.clear();
            int count=0;
        for(int j=i;j<n;j++){
            count+=(nums[j]%p==0);

            if(count>k)break;

            temp.push_back(nums[j]);
            ans.insert(temp);
            }
        }
       return ans.size(); 
    }
};
```
['C++']