O(n)...bahu saras solutioon
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    public int minimumDeletions(String word, int k) {\n        /* STEP 1 : First get the frequencies of each charaacter.... */\n        HashMap<Character, Integer> hm = new HashMap<>();\n        int n = word.length();\n        for (int i = 0; i < n; i++) {\n            char ch = word.charAt(i);\n            hm.put(ch, hm.getOrDefault(ch, 0) + 1);\n        }\n        System.out.println(" hm " + hm);\n        /*\n         * for each element go on and search... freq[j]-freq[i]> k => you\'ll have to\n         * delete these\n         * extra characters... freq[j]<freq[i] => akhuj delete kari nakho.. then check\n         * for all such number of deleteions\n         * for that element...\n         */\n        int min_del = n;\n        List<Integer> arr = new ArrayList<>(hm.values());\n        for (int i = 0; i < arr.size(); i++) {\n            int freq_i = arr.get(i);\n            int curr_del = 0;\n            for (int j = 0; j < arr.size(); j++) {\n                if (i == j) {\n                    continue;\n                }\n                int freq_j = arr.get(j);\n                System.out.println(" freq_i : " + freq_i + " freq_j : " + freq_j);\n                if (freq_j < freq_i) {\n                    System.out.println(" case 1");\n                    curr_del += freq_j;\n                } else if (Math.abs(freq_j - freq_i) > k) {\n                    System.out.println(" case 2");\n                    curr_del += Math.abs(freq_j - freq_i - k);\n                } else {\n                    System.out.println(" case 3 ");\n                    /*\n                     * it is a valid case so no need to worry.\n                     * => Math.abs(freq_j - freq_j) <= k\n                     */\n                }\n                System.out.println(" ---- " + " curr_del " + curr_del + " ---- ");\n            }\n            min_del = Math.min(min_del, curr_del);\n            System.out.println(" curr_del : " + curr_del + " min_del : " + min_del);\n            System.out.println("===============================");\n        }\n\n        return min_del;\n    }\n}\n```
['Java']