[프로그래머스] 09/26 (1)
·
코딩테스트/프로그래머스[Python]
[로또의 최고 순위와 최저 순위]-[2021 Dev-Matching: 웹 백엔드 개발자] My answer def solution(lottos, win_nums): count=0 rank={6:1,5:2,4:3,3:4,2:5,1:6,0:6} for i in lottos: if(i in win_nums): count+=1 answer=[rank[count+lottos.count(0)],rank[count]] return answer Another answer def solution(lottos, win_nums): rank = {0: 6,1: 6,2: 5,3: 4,4: 3,5: 2,6: 1} return [rank[len(set(lottos) & set(win_nums)) + lottos.count(0)]..