https://programmers.co.kr/learn/courses/30/lessons/77484
μ½λ©ν μ€νΈ μ°μ΅ - λ‘λμ μ΅κ³ μμμ μ΅μ μμ
λ‘λ 6/45(μ΄ν 'λ‘λ'λ‘ νκΈ°)λ 1λΆν° 45κΉμ§μ μ«μ μ€ 6κ°λ₯Ό μ°μ΄μ λ§νλ λνμ μΈ λ³΅κΆμ λλ€. μλλ λ‘λμ μμλ₯Ό μ νλ λ°©μμ λλ€. 1 μμ λΉμ²¨ λ΄μ© 1 6κ° λ²νΈκ° λͺ¨λ μΌμΉ 2 5κ° λ²νΈ
programmers.co.kr
νμ΄
# νλ‘κ·Έλλ¨Έμ€ 1λ¨κ³ - λ‘λμ μ΅κ³ μμμ μ΅μ μμ
def solution(lottos, win_nums):
answer = [0,0]
rank = [6,6,5,4,3,2,1]
cnt_0 = lottos.count(0)
ans = 0
for x in win_nums:
if x in lottos:
ans += 1
answer = rank[cnt_0 + ans], rank[ans]
return answer