from itertools import combinations
import sys
input=sys.stdin.readline
L,C=map(int, input().split())
CL=list(map(str,input().split()))
CL.sort()
m=["a", "e", "i", "o", "u"]
a=list(combinations(CL, L))
ss=[]
def bt(a):
for i in a:
cnt=0
i=list(i)
k=list(i)
for j in k:
if j in m:
i.pop(i.index(j))
cnt+=1
if len(i)>=2 and cnt>=1:
ss.append(k)
bt(a)
for i in ss:
for k in i:
print(k,end='')
print(end="\n")
'알고리즘 > 백준' 카테고리의 다른 글
백준-1789번(수들의 합)-python3 (0) | 2023.11.24 |
---|---|
백준-1764번(듣보잡)-python3 (0) | 2023.11.24 |
백준-1712번(손익분기점)-python (0) | 2023.11.24 |
백준-1697번(숨바꼭질)-python3 (0) | 2023.11.24 |
백준-1654번(랜선 자르기)-python (0) | 2023.11.24 |