알고리즘/프로그래머스 - JS

프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 function solution(n, k) { const number = n; const antilogarithm = k; const changeAntilogarithm = number.toString(antilogarithm); let numbersWithoutZero = ''; const result = [...changeAntilogarithm].reduce((acc, cur, index, arr) => { if (cur !== '0') numbersWithoutZero += cur; if (..
나의 풀이 더보기 function solution(priorities, location) { if(priorities.length === 1) return 1 let num = 0 const sample = priorities.reduce((acc,cur,index,arr) => { const max = Math.max(...arr) if (max === cur || acc.filter(x => Object.values(x).includes(max))[0]){ acc.splice(num,0,{[index]:cur}) num += 1 return acc } acc.push({[index] : cur}) return acc },[]) const newArray = filtering(sample) const ..
https://school.programmers.co.kr/learn/courses/30/lessons/17677 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 아직 푸는 중이다. 전부 구현했는데 딱 1개 다중집합 구현에서 브레이크가 걸렸다. function solution(str1, str2) { const CONSTANT = 65536 const makeJaccard = (str) =>{ let pickString = str.toLowerCase().split("") let multipleSet = pickString.reduce((acc,..
https://school.programmers.co.kr/learn/courses/30/lessons/42578 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 1) function solution(clothes) { let box =[] let classification = clothes.reduce((acc,cur) =>{ acc[cur[1]] = acc[cur[1]] ? [].concat(acc[cur[1]],cur[1]): [cur[0]] return acc },{}) for (let item in classification) box.p..
https://school.programmers.co.kr/learn/courses/30/lessons/64065 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 function solution(s) { s = s.replace(/[{}]/g,"").split(",") const checkRepetition = s.reduce((acc,cur) =>{ acc[cur] = (acc[cur]|| 0) + 1 return acc },{}) return Object.entries(checkRepetition).sort(([,a], [,b]) => b -..
https://school.programmers.co.kr/learn/courses/30/lessons/87390 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 function solution(n, left, right, result = []) { for(i=left; i
https://school.programmers.co.kr/learn/courses/30/lessons/76502# 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 function solution(s) { let array = s.slice() let result = 0 for(i=0; i 0){ if(array.includes("{}")) array = array.replace(/{}/g, "") if(array.includes("[]")) array = array.replace(/\[]/g, "") if(array.includes("()"))..
https://school.programmers.co.kr/learn/courses/30/lessons/42747#qna 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 function solution(citations) { let result = 0 for(i = 1; i= i).length) result = i return result } 처음에 문제이해를 잘 못해서 11번 케이스만 틀렸다. "논문 n편 중, h번 인용된 논문이 h편 이상이고 나머지 논문이 h번 이하 인용되었다면 h의 최댓값이 이 과학자의 H-index입니다. " 이렇게 이해..
https://school.programmers.co.kr/learn/courses/30/lessons/12949# 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 function solution(arr1, arr2) { let box = [] let result = [] let sum = 0 for(i=0; i
개발자성장기
'알고리즘/프로그래머스 - JS' 카테고리의 글 목록 (6 Page)