C++ || Short solution
\nclass Solution {\npublic:\n    int countDistinct(vector<int>& nums, int k, int p) {\n        set<vector<int>>s;\n        for(int i=0;i<nums.size();i++){\n    
```\nclass Solution {\npublic:\n    int countDistinct(vector<int>& nums, int k, int p) {\n        set<vector<int>>s;\n        for(int i=0;i<nums.size();i++){\n            int cnt=0;\n            for(int j=i;j<nums.size();j++){\n                if(nums[j]%p==0)    cnt++;\n                if(cnt==k+1){break;}\n                s.insert(vector<int>(nums.begin()+i,nums.begin()+j+1));\n            }\n        }\n        return s.size();\n    }\n};\n```
['C']