Freq count - Java O(26*26)|O(26)
Intuition\n Describe your first thoughts on how to solve this problem. \n Build freq array. \n Loop over each freq, calulate count by adding all lower freq and 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n* Build freq array. \n* Loop over each freq, calulate `count` by adding all lower freq and higher freq beyond current freq + k.\n* Find the minimum `count`.\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```java []\nclass Solution {\n    public int minimumDeletions(String word, int k) {\n        // freq count\n        int[] arr = new int[26];\n        int min = Integer.MAX_VALUE;\n        for (int i = 0; i < word.length(); i++)\n            arr[word.charAt(i) - \'a\']++;\n        for (int i = 0; i < 26; i++) {\n            if (arr[i] == 0)\n                continue;\n            int cnt = 0;\n            for (int j = 0; j < 26; j++) { // go over each freq\n                if (arr[j] == 0)\n                    continue;\n                if (arr[j] < arr[i]) // count lower freq\n                    cnt += arr[j];\n                if (arr[j] > arr[i] + k) // highr freq count to higher freq - current freq - k\n                    cnt += arr[j] > k ? arr[j] - arr[i] - k : 0;\n            }\n            min = Math.min(min, cnt);\n        }\n        return min;\n    }\n}\n```
['Java']