(프로그래머스) 로또의 최고 순위와 최저 순위

유지원·2022년 1월 7일
0

프로그래머스

목록 보기
1/66

문제 링크

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


Javascript

function solution(lottos, win_nums) {
  const rank = [6,6,5,4,3,2,1]
  const min = lottos.filter(l => win_nums.includes(l)).length
  const max = lottos.filter(l => l === 0).length + min
  return [rank[max], rank[min]]
}
profile
👋 https://github.com/ujw0712

0개의 댓글