C++ || Easy to Understand
```\nclass Solution {\npublic:\n    int countDistinct(vector& nums, int k, int p) {\n       \n        sets;\n        int n = nums.size();\n        for(int i = 0
```\nclass Solution {\npublic:\n    int countDistinct(vector<int>& nums, int k, int p) {\n       \n        set<string>s;\n        int n = nums.size();\n        for(int i = 0;i<n;i++)\n        {\n            int c = 0;\n            string str = "";\n            for(int j = i;j<n;j++)\n            {\n                str += nums[j]+\'0\';\n                if(nums[j]%p == 0)\n                    c++;\n                if(c<=k)\n                    s.insert(str);\n                else\n                break;\n                 \n            }\n        }\n        return s.size();  \n    }\n};
['C', 'Ordered Set']