c+ | set | easy to understand
\n# Code\n\nclass Solution {\npublic:\n\n    int countDistinct(vector<int>& nums, int k, int p) {\n        \n        int n=nums.size();\n        set<vector<int>
\n# Code\n```\nclass Solution {\npublic:\n\n    int countDistinct(vector<int>& nums, int k, int p) {\n        \n        int n=nums.size();\n        set<vector<int>>ans;\n        \n        int i,j;\n        for(i=0;i<n;i++)\n        {\n            vector<int>tt;\n            int ct=0;\n            for(j=i;j<n;j++)\n            {\n                tt.push_back(nums[j]);\n                if(nums[j]%p==0)\n                    ++ct;\n                if(ct>k)\n                    break;\n                ans.insert(tt);\n                    \n            }\n        }\n        return ans.size();\n    }\n    \n};\n```
['C++']