본문 바로가기

전체 글540

[LeetCode] (Math) Lv Easy. Fizz Buzz https://leetcode.com/explore/interview/card/top-interview-questions-easy/102/math/743/ 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} n * @return {string[]} */ function fizzBuzz(n) { let answer = .. 2023. 1. 22.
[LeetCode] (Dynamic Programming) Lv Easy. Climbing Stairs https://leetcode.com/explore/interview/card/top-interview-questions-easy/97/dynamic-programming/569/ 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} n * @return {number} */ var climbStairs = functi.. 2023. 1. 22.
[LeetCode] (Sorting and Searching) Lv Easy. First Bad Version https://leetcode.com/explore/interview/card/top-interview-questions-easy/96/sorting-and-searching/774/ 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 /** * Definition for isBadVersion() * * @param {integer} version num.. 2023. 1. 22.
[LeetCode] (Sorting and Searching) Lv Easy. Merge Sorted Array https://leetcode.com/explore/interview/card/top-interview-questions-easy/96/sorting-and-searching/587/ 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[]} nums1 * @param {number} m * @param {number[].. 2023. 1. 22.
[Programmers] Lv 2. 최솟값 만들기 https://school.programmers.co.kr/learn/courses/30/lessons/12941 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr function solution(A, B) { A.sort((a, b) => a - b); B.sort((a, b) => b - a); return A.reduce((acc, e, i) => (acc += e * B[i]), 0); } GitHub : https://github.com/developeSHG/Algorithm-Baekjoon_Programmers/tree/main/%ED%94%84%.. 2023. 1. 22.
[Programmers] Lv 2. JadenCase 문자열 만들기 https://school.programmers.co.kr/learn/courses/30/lessons/12951 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr const solution = (s) => s.split(" ").map((v) => v.charAt(0).toUpperCase() + v.substring(1).toLowerCase()).join(" "); GitHub : https://github.com/developeSHG/Algorithm-Baekjoon_Programmers/tree/main/%ED%94%84%EB%A1%9C%EA%B7%.. 2023. 1. 22.
[Programmers] Lv 2. 최댓값과 최솟값 https://school.programmers.co.kr/learn/courses/30/lessons/12939 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr function solution(s) { const arr = s.split(' '); return Math.min(...arr)+' '+Math.max(...arr); } 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.. 2023. 1. 22.
[Programmers] Lv 2. 점 찍기 https://school.programmers.co.kr/learn/courses/30/lessons/140107 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr function solution(k, d) { let answer = 0; const getY = (num) => Math.sqrt(d ** 2 - num ** 2); for (let i = 0; i 2023. 1. 22.
[LeetCode] (Trees) Lv Easy. Maximum Depth of Binary Tree https://leetcode.com/explore/interview/card/top-interview-questions-easy/94/trees/555/ 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 /** * Definition for a binary tree node. * function TreeNode(val, left, right) { * t.. 2023. 1. 21.
[Programmers] Lv 2. 연속 부분 수열 합의 개수 https://school.programmers.co.kr/learn/courses/30/lessons/131701 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr function solution(elements) { var answer = new Set(); elements.forEach((e, i) => { let acc = 0; for (const j in elements) { let idx = (parseInt(j) + i) % elements.length; acc += elements[idx]; answer.add(acc); } }); return.. 2023. 1. 21.