(프로그래머스) 폰켓몬

유지원·2022년 4월 4일
0

프로그래머스

목록 보기
14/66

문제 링크

https://programmers.co.kr/learn/courses/30/lessons/1845?language=javascript


Javascript

function solution(nums) {
  const max = nums.length / 2
  const noDup = [...new Set(nums)].length;
  return max < noDup ? max : noDup
}
profile
👋 https://github.com/ujw0712

0개의 댓글