폰켓몬
-
[JS] 폰켓몬이노베이션 캠프/3주차_알고리즘 2023. 6. 21. 14:19
문제 https://school.programmers.co.kr/learn/courses/30/lessons/1845 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 문제 풀이 function solution(nums) { // 1) 주어진 nums에서 중복된 값 제외한 새로운 배열 생성 let temp = [...new Set(nums)]; // 2) nums의 길이를 가져와 2로 나눈 값 저장 let len = nums.length / 2; // 3) nums에서 중복 제거하여 만든 배열의 길이 저장 let templen = temp.length; //..