Worst c++ solution that beats only 5% runtime but its easy to understand
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    void solve(vector<int> &nums, int &ans, int index,vector<int>ele,int &k){\n        if(index == nums.size()){\n            return;\n        }\n        for(int i=index+1;i<nums.size();i++){\n            int a = nums[i];\n            bool beauty = true;\n            for(int j =0;j<ele.size();j++){\n                if(a-ele[j] == k || a-ele[j] == -k){\n                    beauty = false;\n                    break;\n                }\n            }\n            \n            if(beauty){\n                ele.push_back(a);\n                ans++;\n                solve(nums,ans,i,ele,k);\n                ele.pop_back();\n            }\n        }\n    }\n    int beautifulSubsets(vector<int>& nums, int k) {\n        sort(nums.begin(),nums.end());\n        int ans = 0;\n        vector<int> ele;\n        solve(nums,ans,-1,ele, k);\n        return ans;\n        \n    }\n};\n```
['C++']