From 6ffd47cb9528e3446d6fc9d7c518b4bab41b829b Mon Sep 17 00:00:00 2001 From: seongwon030 <105052068+seongwon030@users.noreply.github.com> Date: Mon, 13 May 2024 20:34:15 +0900 Subject: [PATCH] =?UTF-8?q?2024-05-13=20=EC=95=94=ED=98=B8=EB=A7=8C?= =?UTF-8?q?=EB=93=A4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...70\353\247\214\353\223\244\352\270\260.py" | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 "seongwon030/\353\270\214\353\243\250\355\212\270\355\217\254\354\212\244/\354\225\224\355\230\270\353\247\214\353\223\244\352\270\260.py" diff --git "a/seongwon030/\353\270\214\353\243\250\355\212\270\355\217\254\354\212\244/\354\225\224\355\230\270\353\247\214\353\223\244\352\270\260.py" "b/seongwon030/\353\270\214\353\243\250\355\212\270\355\217\254\354\212\244/\354\225\224\355\230\270\353\247\214\353\223\244\352\270\260.py" new file mode 100644 index 0000000..1ed7260 --- /dev/null +++ "b/seongwon030/\353\270\214\353\243\250\355\212\270\355\217\254\354\212\244/\354\225\224\355\230\270\353\247\214\353\223\244\352\270\260.py" @@ -0,0 +1,21 @@ +from itertools import combinations + +L,C = map(int,input().split()) + +k = list(map(str,input().split())) +vowels = 'aeiou' + +vowel_cnt = 0 +consonant_cnt = 0 + +result = [] +for c in combinations(k,L): + vowel_str = ''.join(sorted(c)) + vowel_cnt = sum(1 for char in vowel_str if char in vowels) + consonant_cnt = L - vowel_cnt + if vowel_cnt >=1 and consonant_cnt >=2: + result.append(vowel_str) + +result.sort() +for word in result: + print(word) \ No newline at end of file