로또의 최고 순위와 최저 순위1 [프로그래머스][자바스크립트][Level1] 로또의 최고 순위와 최저 순위 /** * 로또의 최고 순위와 최저 순위 * https://programmers.co.kr/learn/courses/30/lessons/77484 */ function solution(lottos, win_nums) { let min = 7, max = 7, match = 0; const joker = lottos.reduce((acc, num) => { if (num === 0) acc++; return acc; } , 0); const lottosWithoutJoker = lottos.filter((num) => num !== 0); lottosWithoutJoker.forEach((num) => { if (win_nums.some((winNum) => winNum === num)) match++ }.. 2022. 1. 1. 이전 1 다음