Post

๐Ÿน ๐Ÿ”„ ๊ฐ€๋ฅด์นจ

1. ๋ฌธ์ œ ๋งํฌ

1062๋ฒˆ: ๊ฐ€๋ฅด์นจ


2. ์ฝ”๋“œ

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from collections import Counter

N, K = map(int, input().split())
words = ''
essential_alpha = ['a', 'c', 'i', 'n', 't']

for _ in range(N):
    word = input()
    l = len(word)
    word = word[4:l-4]
    words += word

if K < 5:
    print(0)
else:
    words = list(words)
    words_set = list(words)
    sorted_alpha = []
    for w in words_set:
        if w in essential_alpha:
            continue
        sorted_alpha.append((words.count(w), w))
    


This post is licensed under CC BY 4.0 by the author.