[프로그래머스] 로또의 최고 순위와 최저 순위

Doodung·2021년 7월 15일
0

코딩테스트

목록 보기
3/8
def solution(lottos, win_nums):
    answer = []
    count=0
    zero_count=0
    dic={0:6,1:6,2:5,3:4,4:3,5:2,6:1}
    
    for i in win_nums:
        if i in lottos:
            lottos.remove(i)
            count=count+1
        
    zero_count=lottos.count(0)
    answer=[dic[count+zero_count],dic[count]]
    
    return answer
profile
반가워요!

0개의 댓글