문제 링크: https://www.acmicpc.net/problem/1759
백준 알고리즘 기초 2/2 530에서 2번째 - 1759번 암호 만들기를 풀어보았다.
풀이: https://it-garden.tistory.com/271 를 참고했다.
C++
Python
from itertools import combinations
l,c=map(int,input().split())
strs=list(input().split())
strs.sort()
vowel=set('aeiou')
res=list(combinations(strs,l))
for i in res:
check=set(i)-vowel
c=len(check)
if c>=2 and l-c>=1:
print("".join(i))
Java
'코테용 문제풀이 > 백준' 카테고리의 다른 글
스타트와 링크 풀이 (0) | 2023.01.29 |
---|---|
퇴사 풀이 (0) | 2023.01.29 |
로또 풀이 (0) | 2023.01.28 |
외판원 순회 2 풀이 (0) | 2023.01.25 |
차이를 최대로 풀이 (0) | 2023.01.25 |