DP Memoization
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    Integer [][] dp;\n    public int helper(List<Integer> arr, int start, int end, int k) {\n        if(start >= end) {\n            return 0;\n        }\n        \n        int diff = arr.get(end) - arr.get(start);\n        if(diff <= k) {\n            return 0;\n        }\n        \n        if(dp[start][end] != null) {\n            return dp[start][end];\n        }\n\n        int remove = arr.get(start) + helper(arr, start + 1, end, k);\n        int reduce = diff - k + helper(arr, start, end - 1, k);\n        \n        return dp[start][end] = Math.min(remove, reduce);\n    }\n\n    public int minimumDeletions(String word, int k) {\n        Map<Character, Integer> freq = new HashMap<>();\n        \n        for(char c : word.toCharArray()) {\n            freq.put(c, freq.getOrDefault(c, 0) + 1);\n        }\n        \n        List<Integer> arr = new ArrayList<>(freq.values());\n        arr.sort(null);\n        \n        this.dp = new Integer [26][26];\n        return helper(arr, 0, arr.size() - 1, k);\n    }\n}\n\n```
['Java']