diff --git "a/leetcode3/\352\271\200\353\257\274\354\240\234/3014.py" "b/leetcode3/\352\271\200\353\257\274\354\240\234/3014.py" new file mode 100644 index 00000000..17b83be1 --- /dev/null +++ "b/leetcode3/\352\271\200\353\257\274\354\240\234/3014.py" @@ -0,0 +1,19 @@ +from collections import Counter + +class Solution: + def minimumPushes(self ,word:str) -> int: + count = Counter(word) + frequencies = sorted(count.values(), reverse=True) + + answer = 0 + + for i,freq in enumerate(frequencies): + push = i//8 +1 + answer += push * freq + + return answer + + +input = 'aabcde' +solution = Solution() +print(solution.minimumPushes(input))