Skip to content

Commit

Permalink
2024-05-13 암호만들기
Browse files Browse the repository at this point in the history
  • Loading branch information
seongwon030 committed May 13, 2024
1 parent 0529f80 commit 6ffd47c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions seongwon030/브루트포스/암호만들기.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 6ffd47c

Please sign in to comment.