from itertools import combinations from collections import Counter def solution(orders, course): answer = [] for c in course : com = [] for order in orders : com.extend(combinations(sorted(order), c)) com = Counter(com).most_common() com = list(map(lambda x : x[0], filter(lambda x : x[1]==com[0][1] and x[1]!= 1, com))) if com : answer.extend(com) return sorted(map(lambda x: ''.join(x),answer)) 풀..