본문 바로가기

전체 글540

[Programmers] (정렬) Lv 2. H-Index https://school.programmers.co.kr/learn/courses/30/lessons/42747 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr const solution = (citations) => citations.sort((a, b) => b - a).filter((e, idx) => e > idx).length; GitHub : https://github.com/developeSHG/Algorithm-Baekjoon_Programmers/tree/main/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8.. 2023. 2. 4.
[Programmers] (Summer/Winter Coding(~2018)) Lv 2. 점프와 순간 이동 https://school.programmers.co.kr/learn/courses/30/lessons/12980 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr const solution = (n) => [...n.toString(2)].filter(Number).length; GitHub : https://github.com/developeSHG/Algorithm-Baekjoon_Programmers/tree/main/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4/lv2/12980.%E2%80%85%E.. 2023. 2. 3.
[Programmers] (2017 팁스타운) Lv 2. 예상 대진표 https://school.programmers.co.kr/learn/courses/30/lessons/12985 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr function solution(n, a, b) { [a, b] = a > b ? [b, a] : [a, b]; for (var i = 1; i 2023. 2. 1.
[Programmers] Lv 2. 멀리 뛰기 https://school.programmers.co.kr/learn/courses/30/lessons/12914 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr function solution(n) { let dp = [0, 1, 2]; for (let i = 3; i 2023. 2. 1.
[LeetCode] (Array) Lv Easy. Rotate Array https://leetcode.com/explore/interview/card/top-interview-questions-easy/92/array/646/ Explore - LeetCode LeetCode Explore is the best place for everyone to start practicing and learning on LeetCode. No matter if you are a beginner or a master, there are always new topics waiting for you to explore. leetcode.com /** * @param {number[]} nums * @param {number} k * @return {void} Do not return anyt.. 2023. 1. 31.
[Programmers] Lv 2. N개의 최소공배수 https://school.programmers.co.kr/learn/courses/30/lessons/12953 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr function solution(arr) { let loop = 1; while (arr.reduce((acc, e) => (!((loop * arr[0]) % e) ? ++acc : acc), 0) !== arr.length) ++loop; return loop * arr[0]; } GitHub : https://github.com/developeSHG/Algorithm-Baekjoon_Prog.. 2023. 1. 30.
[Programmers] (완전탐색) Lv 2. 카펫 https://school.programmers.co.kr/learn/courses/30/lessons/42842 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr function solution(brown, yellow) { var answer = []; const SUM = brown + yellow; for (height = 3; height 2023. 1. 27.
[Programmers] (Summer/Winter Coding(~2018)) Lv 2. 영어 끝말잇기 https://school.programmers.co.kr/learn/courses/30/lessons/12981 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr function solution(n, words) { let lastWord = words[0].charAt(0), idx = 0; const from = []; for (const word of words) { if (word.charAt(0) !== lastWord || from[word]) return [(idx % n) + 1, Math.floor(idx / n) + 1]; lastWord.. 2023. 1. 27.
[Programmers Test] (2회차 코딩테스트) No 5. WordTrain [문제 설명] 전 세계의 알파벳들이 기차놀이를 하기 위해서 한 장소에 모였습니다. 뒤죽박죽 같은 스펠링의 알파벳들도 섞여 들어가 있습니다. 여기에서 반복 없이 가장 긴 알파벳 길이를 구하는 함수, solution을 완성해주세요. 예를 들어, 문자열 s가 `abssccbsbsv` 일 때, 반복 없이 가장 긴 알파벳 길이는 3입니다. [제한 사항] - 기차놀이의 참가한 알파벳은 중복될 수 있습니다. - 반복 없는 가장 긴 문자열을 찾습니다. [입력 형식] - s는 길이가 1 이상 1,000 이하인 문자열입니다. [출력 형식] - 반복 없이 가장 긴 알파벳 길이를 출력합니다. /** * @param s {string} * @returns {number} */ function solution(s) { const.. 2023. 1. 27.
[Programmers Test] (2회차 코딩테스트) No 4. palindrome 문자열 S는 하나의 단어를 나타냅니다. 단어를 거꾸로 뒤집어도 똑같은 것을 회문이라고 합니다. 주어진 단어가 회문인경우 1, 아닌경우 0을 리턴하는 함수를 구현하세요. [입력] 1000자 미만의 문자열 S (알파벳 대문자) [출력] 회문 인경우 1, 그렇지 않은 경우 0 매개변수 : String S 리턴타입 : int const solution = (S) => { let reverse = S.split("").reverse().join(""); return (S === reverse) ? 1 : 0; } 2023. 1. 27.