티스토리 뷰

programmers.co.kr/learn/courses/30/lessons/77484

나의 풀이

import Foundation

func solution(_ lottos:[Int], _ win_nums:[Int]) -> [Int] {

    let zeroCount = lottos.filter { $0 == 0}.count
    let winCount: Int = win_nums.filter { lottos.contains($0) }.count

    return [min(7-winCount-zeroCount,6), min(7-winCount,6)]
}

 

댓글
공지사항