[프로그래머스] 폰켓몬

dev_jo·2022년 8월 19일
0

알고리즘 풀이

목록 보기
11/25

문제

폰켓몬



문제풀이

function solution(nums) {
    
    var answer = 0;
    var chance = nums.length / 2;
    var set = new Set(nums);
    var unique = [...set];
    
    answer = unique.length < chance ? unique.length : chance;
    
    return answer;
}
profile
To be a better developer!!

0개의 댓글