Why its showing TLE ?|| even all 129 test cases have been passed
\n    int countDistinct(vector<int>& nums, int k, int p) {\n        int ans = 0;\n        set<vector<int>> set;\n        for(int i=0; i <nums.size(); i++){\n   
```\n    int countDistinct(vector<int>& nums, int k, int p) {\n        int ans = 0;\n        set<vector<int>> set;\n        for(int i=0; i <nums.size(); i++){\n            int r = k;\n            if(nums[i] % p == 0)\n                --r;\n            vector<int> s;\n            s.push_back(nums[i]);\n            int j = i + 1;\n            while(r >= 0 && j<=nums.size()){\n                if(!set.count(s)){\n                    ++ans;\n                    set.insert(s);\n                }\n                if(j<nums.size())\n                    s.push_back(nums[j]);\n                else break;\n                if(nums[j] % p == 0){\n                    --r;\n                }\n                ++j;\n            }\n        }\n        \n        return ans;\n    }\n```
['Ordered Set']