Generate all Subarray
Generate all subarray and check the given condition.\n\nPS : Appending characters corresponding to ascii into currSubArray\ntreating Integer values as ASCII val
**Generate all subarray and check the given condition.**\n\n**PS : Appending characters corresponding to ascii into currSubArray**\n**treating Integer values as ASCII values so that they become unique**\n```\nstring str;\nstr.push_back(65);\ncout << str;\n\nIt will print "A".\n```\n\n```\nclass Solution {\npublic:\n    int countDistinct(vector<int>& nums, int k, int p) {\n        \n        int n(size(nums)), res(0);\n        unordered_set<string> all; // stores unique substrings which satisfy the given condition.\n        \n        for (int i=0; i<n; i++) {\n            int cnt(0);\n            string currSubArray; // stores subarray starting from index i.\n            for (int j=i; j<n; j++) {\n                currSubArray.push_back(nums[j]); // Appending charcter with nums[j] ascii value.\n                if (nums[j] % p == 0)  cnt++;\n                // if the current array have at most k elements divisible by  then add it to the set.\n                if (cnt <= k)    all.insert(currSubArray);\n            }\n        }\n        return size(all);\n    }\n};\n```
['C']