반응형 순위검색 파이썬1 [파이썬🐍] 프로그래머스 : 순위 검색 from itertools import combinations from collections import defaultdict import bisect def solution(info, query): answer = [] people = defaultdict(list) for i in info: person = i.split() score = int(person[-1]) people[''.join(person[:-1])].append(score) for j in range(4): candi = list(combinations(person[:-1], j)) for c in candi: people[''.join(c)].append(score) for i in people: people[i].sort() #.. 2023. 1. 11. 이전 1 다음 반응형