[프로그래머스 문제풀이2]로또의 최저순위와 최고순위 javascript

이ᄏᄋ·2021년 9월 13일
0
function solution(lottos, win_nums) {
    let max=7;
    let min=7;
    lottos.map(lotto=>{
        if(win_nums.includes(lotto))
            {
                max-=1;
                min-=1;
            }
    })
    lottos.map(lotto=>{
        if(lotto===0)
            max-=1
    })

   
    return  [max===7?6:max, min===7?6:min];
}

profile
미쳤다.

0개의 댓글