get count of subsets as per the condition
\nclass Solution {\npublic:\n    \n    int res = 0;\n    int k ;\n    void solve(vector<int> &a,int i,unordered_map<int , int> &mp)\n    {\n        if(i >= a.si
```\nclass Solution {\npublic:\n    \n    int res = 0;\n    int k ;\n    void solve(vector<int> &a,int i,unordered_map<int , int> &mp)\n    {\n        if(i >= a.size()){\n            res++;\n            return;\n        }\n        \n        solve(a,i+1,mp);\n        if(!mp[a[i]-k] && !mp[a[i]+k]){\n        mp[a[i]]++;\n        solve(a,i+1,mp);\n        mp[a[i]]--;\n        }\n\n\n    }\n\n\n    \n    int beautifulSubsets(vector<int>& a, int kk) {\n        \n        int n = a.size();\n        k = kk;\n        unordered_map<int ,int> mp;\n        solve(a,0,mp);\n        \n        return res-1;\n        \n    }\n};\n```
['C']