문제
풀이 과정
const solutionA = (lottos, win_nums) => {
const answer = [];
const ranks = [6, 6, 5, 4, 3, 2, 1];
const correctCount = lottos.filter((lotto) => win_nums.includes(lotto)).length;
const zeroCount = lottos.filter((lotto) => lotto === 0).length;
const high = ranks[correctCount + zeroCount];
const low = ranks[correctCount];
answer.push(high, low);
return answer;
};
const lottos = [44, 1, 0, 0, 31, 25];
const win_nums = [31, 10, 45, 1, 6, 19];
const testA = solutionA(lottos, win_nums);
console.log(testA);
틀린 부분이 있거나 보충해야 할 내용이 있다면 댓글이나 DM(sungstonemin)으로 알려주시면 감사하겠습니다😄