Python (Simple Backtracking)
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    def beautifulSubsets(self, nums, k):\n        n, dict1 = len(nums), defaultdict(int)\n\n        def dfs(i):\n            total = 0\n\n            for j in range(i,n):\n                if dict1[nums[j]+k] == 0 and dict1[nums[j]-k] == 0:\n                    dict1[nums[j]] += 1\n                    total += dfs(j+1) + 1\n                    dict1[nums[j]] -= 1\n\n            return total \n\n        return dfs(0)\n\n        \n\n\n\n```
['Python3']