C++ rolling hash
didn\'t check collision\n```\n    int countDistinct(vector& nums, int k, int p) {\n        unordered_map> hashMap; //len, {hash}\n        int res = 0;\n        
didn\'t check collision\n```\n    int countDistinct(vector<int>& nums, int k, int p) {\n        unordered_map<int, unordered_set<int>> hashMap; //len, {hash}\n        int res = 0;\n        for (int i=0; i<nums.size(); i++){\n            long long hash = 0, cntP = 0, mod = 1e9+7, pow = 200;\n            for(int j=i; j < nums.size(); j++){\n                if (nums[j] % p == 0) cntP++;\n                if (cntP > k) break;\n                hash = (hash * pow + nums[j]) % mod;\n                if (hashMap[j-i+1].insert(hash).second) res++;\n            }\n        }\n        return res;\n    }
[]