from itertools import combinations from collections import Counter def solution(orders, course): answer = [] for i, o in enumerate(orders): orders[i] = ''.join(sorted(o)) for courseLen in course: comb_list = [] for ord in orders: order_list = list(ord) comb_list += list(combinations(order_list, courseLen)) commons = Counter(comb_list).most_common() answer += [''.join(k) for k,v in commons if com..