Created
March 25, 2020 04:12
-
-
Save inspirit941/fa802afa877b9d5c2044ecf693ce1077 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import combinations | |
import sys | |
L, C = map(int, sys.stdin.readline().split()) | |
arr = sys.stdin.readline().split() | |
arr.sort() | |
vowel = {'a','e','i','o','u'} | |
consonant = set(list("abcdefghijklmnopqrstuvwxyz")) - vowel | |
candidate = combinations(range(len(arr)), L) | |
for value in candidate: | |
temp = [] | |
for i in range(L): | |
temp.append(arr[value[i]]) | |
if len(set(temp) & vowel) >= 1 and len(set(temp) & consonant) >= 2: | |
print("".join(temp)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment