👌Runtime 14 ms  Beats 77.08% of users with Go
Code\n\nfunc minimumDeletions(word string, k int) int {\n\tfreq := make([]int, 26)\n\tfor _, ch := range word {\n\t\tfreq[ch-\'a\']++\n\t}\n\n\tsort.Ints(freq)\
# Code\n```\nfunc minimumDeletions(word string, k int) int {\n\tfreq := make([]int, 26)\n\tfor _, ch := range word {\n\t\tfreq[ch-\'a\']++\n\t}\n\n\tsort.Ints(freq)\n\tminDel := int(^uint(0) >> 1) // MaxInt\n\n\tfor i := len(freq) - 1; i >= 0; i-- {\n\t\ttrgt := freq[i]\n\t\tdels := 0\n\n\t\tfor _, f := range freq {\n\t\t\tif f > trgt+k {\n\t\t\t\tdels += f - (trgt + k)\n\t\t\t} else if f < trgt {\n\t\t\t\tdels += f\n\t\t\t}\n\t\t}\n\n\t\tminDel = min(minDel, dels)\n\t\tif minDel == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif minDel == int(^uint(0)>>1) {\n\t\treturn 0\n\t}\n\treturn minDel\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n```
['Go']