
[Python] 백준 #1759- 암호 만들기
·
코딩테스트/백준[Python]
문제 1759번: 암호 만들기 첫째 줄에 두 정수 L, C가 주어진다. (3 ≤ L ≤ C ≤ 15) 다음 줄에는 C개의 문자들이 공백으로 구분되어 주어진다. 주어지는 문자들은 알파벳 소문자이며, 중복되는 것은 없다. www.acmicpc.net 코드 My answer from itertools import combinations import sys input = sys.stdin.readline L, C = map(int, input().split()) letter = list(input().split()) vowels = ['a', 'e', 'i', 'o', 'u'] a = list(combinations(letter, L)) a = ["".join(sorted(i)) for i in a] for i..