위장 (1) 썸네일형 리스트형 [프로그래머스] 위장 - 자바스크립트 문제 설명 문제 풀이 function solution(clothes) { let clothesType = []; let uniqueClothesType = []; let temp = []; let temptemp = []; // clothesType에 옷 각 옷의 종류만 넣어준다. clothes.forEach(function(element) { clothesType.push(element[1]) }); // 옷 종류의 중복 값을 제거해준다. uniqueClothesType = Array.from(new Set(clothesType)); // 중복 값을 제거한 옷 종류와 제거하지 않은 옷 종류를 대조하여 temp에 값을 넣어 준다. for(let i = 0; i a * b) - 1; } 경우의 수를 보는 .. 이전 1 다음