Concise javascript code
very similat to questions like permutations, combinations, and subsets on leetcode, they all follow a particular pattern .\n\nI made a repo where i have all the
very similat to questions like permutations, combinations, and subsets on leetcode, they all follow a particular pattern .\n\nI made a repo where i have all the solutions to questions that i have done on leetcode, https://github.com/Abhaydutt2003/DataStructureAndAlgoPractice/tree/master/src\n\n\n\n\n# Code\n```\n/**\n * @param {number[]} nums\n * @param {number} k\n * @return {number}\n */\nvar beautifulSubsets = function (nums, k) {\n  let map = new Map();\n  let answer = 0;\n  const getAns = (start) => {\n    if (map.size > 0) answer++;\n    if (start >= nums.length) return;\n    for (let i = start; i < nums.length; i++) {\n      if (map.has(nums[i] - k) || map.has(nums[i] + k)) continue;\n      map.set(nums[i], (map.get(nums[i]) || 0) + 1);\n      getAns(i + 1);\n      map.set(nums[i], map.get(nums[i]) - 1);\n      if (map.get(nums[i]) === 0) map.delete(nums[i]);\n    }\n  };\n  getAns(0);\n  return answer;\n};\n```
['Backtracking', 'JavaScript']