very simple c++ solution using set
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 {\n\npublic:\nvoid  f(int ind,vector<int> &nums,int k,unordered_set<int> &s,int &count){\n  count++;\n  for(int j=ind;j<nums.size();j++){\n      if(s.find(nums[j]-k)==s.end()){\n         s.insert(nums[j]);\n    f(j+1,nums,k,s,count);\n    s.erase(nums[j]);\n      }\n  }\n  \n}\n    int beautifulSubsets(vector<int>& nums, int k) {\n        unordered_set<int> s;\n       sort(nums.begin(),nums.end());\n        int count=-1;\n        f(0,nums,k,s,count);\n      return count;\n    }\n};\n```
['C++']