diff --git a/72411_py_jy.py b/72411_py_jy.py new file mode 100644 index 0000000..80f1e3c --- /dev/null +++ b/72411_py_jy.py @@ -0,0 +1,16 @@ +from itertools import combinations +from collections import Counter + +def solution(orders, course): + answer = [] + for cs in course: + tmp = [] + for od in orders: + cb = combinations(sorted(od), cs) + tmp += cb + ct = Counter(tmp) + if len(ct) != 0 and max(ct.values()) != 1: + answer += [''.join(ff) for ff in ct if + ct[ff] == max(ct.values())] + answer = sorted(answer) + return answer \ No newline at end of file