Skip to content

Commit

Permalink
Merge pull request #50 from AlgoLeadMe/12-seongwon030
Browse files Browse the repository at this point in the history
12-seongwon030
  • Loading branch information
seongwon030 authored May 23, 2024
2 parents 973e3d5 + 6ffd47c commit 6545a12
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 6545a12

Please sign in to comment.