There was an error while loading. Please reload this page.
1 parent f242999 commit a5cd487Copy full SHA for a5cd487
1 file changed
leetcode3/김민제/3014.py
@@ -0,0 +1,19 @@
1
+from collections import Counter
2
+
3
+class Solution:
4
+ def minimumPushes(self ,word:str) -> int:
5
+ count = Counter(word)
6
+ frequencies = sorted(count.values(), reverse=True)
7
8
+ answer = 0
9
10
+ for i,freq in enumerate(frequencies):
11
+ push = i//8 +1
12
+ answer += push * freq
13
14
+ return answer
15
16
17
+input = 'aabcde'
18
+solution = Solution()
19
+print(solution.minimumPushes(input))
0 commit comments