100% || C++
IntuitionTry putting element one by one in the vector and if any of the condition is not violated, just put it in the setCode
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

Try putting element one by one in the vector and if any of the condition is not violated, just put it in the set

# Code
```cpp []
class Solution {
public:
    int countDistinct(vector<int>& nums, int k, int p) {
        unordered_set <string> hash;

        for(int i=0;i<nums.size();i++){
            string temp="";
            int count=0;
            for(int j=i;j<nums.size();j++){
                int ele=nums[j];
                temp+=to_string(ele)+",";

                if(ele%p==0) count++;
                if(count>k) break;

                hash.insert(temp);
            }
        }
        return hash.size();
    }
};
```
['C++']