BRUTE FORCE || C++ || TIME (2^n)
CHECK FOR ALL POSSIBLE SUBSETS\n# Code\n\nclass Solution {\npublic:\n    bool check(int x,int k,vector<int> &v){\n        for(auto &i: v){\n            if(abs(i
CHECK FOR ALL POSSIBLE SUBSETS\n# Code\n```\nclass Solution {\npublic:\n    bool check(int x,int k,vector<int> &v){\n        for(auto &i: v){\n            if(abs(i-x)==k)return false;\n        }\n        return true;\n    }\n    void solve(int s,vector<int> &nums,int k,vector<int> &v,int &ans){\n        if(s==nums.size()){\n            ans++;\n            return;\n        }\n\n        if(check(nums[s],k,v)){\n            v.push_back(nums[s]);\n            solve(s+1,nums,k,v,ans);\n            v.pop_back();\n        }\n        solve(s+1,nums,k,v,ans);\n    } \n    int beautifulSubsets(vector<int>& nums, int k) {\n        int ans = -1;\n        vector<int> v;\n        solve(0,nums,k,v,ans);\n        return ans;\n    }\n};\n```
['Array', 'Dynamic Programming', 'Backtracking', 'Recursion', 'C++']