Hashmap + Sort + Binary Search + Recursion JS
\n# Code\n\n/**\n * @param {string} word\n * @param {number} k\n * @return {number}\n */\nvar minimumDeletions = function(word, k) {\n    const map = new Map()\
\n# Code\n```\n/**\n * @param {string} word\n * @param {number} k\n * @return {number}\n */\nvar minimumDeletions = function(word, k) {\n    const map = new Map()\n    \n    for (const char of word) {\n        if (map.has(char)) {\n            map.set(char, map.get(char) + 1)\n        } else {\n            map.set(char, 1)\n        }\n    }\n    \n    let vals = [...map.values()]\n    vals.sort((a, b) => a - b)\n    \n    const traverse = (index) => {\n        if (index >= vals.length) return 0\n        \n        let tmp = 0\n        const startIndex = binarySearch(vals, vals[index] + k + 1)\n        for (let i = startIndex; i < vals.length; i++) {\n            if (vals[i] - vals[index] <= k) continue\n            tmp += (vals[i] - vals[index] - k)\n        }\n        \n        return Math.min(tmp, vals[index] + traverse(index + 1))\n    }\n    \n    return traverse(0)\n};\n\n\nlet binarySearch = (arr, target) => {\n    let left = 0;\n    let right = arr.length;\n    while (left < right) {\n        let mid = Math.floor((left + right) / 2);\n        if (arr[mid] >= target) {\n            right = mid;\n        } else {\n            left = mid + 1;\n        }\n    }\n\n    return left;\n}\n```
['JavaScript']