코딩문제
로또의 최고 순위와 최저 순위 (2021 Dev-Matching: 웹 백엔드 개발자(상반기)
JihyunLee
2022. 6. 6. 16:08
1
2
3
4
5
6
7
8
9
10
11
|
def solution(lottos, win_nums):
cnt_0 = lottos.count(0)
same = 0
for num in lottos:
if num in win_nums:same +=1
low = min(7-same,6)
high = min(7-(same+cnt_0),6)
answer = [high, low]
return answer
|
cs |