가끔 올릴예정 오늘 푼문제
function solution(lottos, win_nums) {
let match = {6:1,5:2,4:3,3:4,2:5,1:6,0:6};
let zero=0;
let counter=0;
lottos.forEach(num=>{if(num == 0){zero++;}});
win_nums.forEach(num=>{lottos.forEach(n=>{if(n==num){counter++;}})});
return [match[zero+counter],match[counter]];
}
'코테' 카테고리의 다른 글
코테 - 연습문제 - 카드뭉치 (0) | 2023.06.19 |
---|---|
코테 - 완전탐색 - 최소 직사각형 (0) | 2023.06.15 |
코테 - 콜라 (0) | 2023.06.08 |
코테 - 탐욕법 lev1 (0) | 2023.05.30 |
코테 - 두 개 뽑아서 더하기 (0) | 2023.03.31 |