일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
- math
- 알고리즘
- java
- Algorithm
- SasS
- 자료형
- string
- 변수
- scss
- dynamic programming
- hash table
- 파이썬
- Python
- JavaSceipt
- vue.js
- JS
- 코딩테스트
- 자료구조
- CSS
- JavaScript
- 컴포넌트
- computed
- HTML
- greedy
- sorting
- 프로그래머스
- leetcode
- github
- 백준
- array
- Today
- Total
목록알고리즘 (108)
Posis
[프로그래머스][JavaScript] 폰켓몬 문제 출처: https://programmers.co.kr/learn/courses/30/lessons/1845 코딩테스트 연습 - 폰켓몬 당신은 폰켓몬을 잡기 위한 오랜 여행 끝에, 홍 박사님의 연구실에 도착했습니다. 홍 박사님은 당신에게 자신의 연구실에 있는 총 N 마리의 폰켓몬 중에서 N/2마리를 가져가도 좋다고 했습니다. programmers.co.kr [직접 푼 코드] function solution(nums) { const arr = new Set(nums); if (nums.length / 2 > arr.size) { return arr.size; } else { return nums.length / 2; } } [문제 풀이] 1. Set 객체를 ..
[LeetCode][JavaScript] 88. Merge Sorted Array 문제 출처: https://leetcode.com/problems/merge-sorted-array/ Merge Sorted Array - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com [직접 푼 코드] var merge = function (nums1, m, nums2, n) { nums1.splice(m, n, ...nums2); nums1.sort((a, b) => a - b..
[LeetCode][JavaScript] 561. Array Partition I 문제 출처: https://leetcode.com/problems/array-partition-i/ Array Partition I - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com [직접 푼 코드] var arrayPairSum = function(nums) { nums.sort((a,b) => a-b) let result = 0 for(let i=0; i
[LeetCode][JavaScript] 1436. Destination City 문제 출처: https://leetcode.com/problems/destination-city/ Destination City - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com [직접 푼 코드] var destCity = function(paths) { let dest = paths[0][1] while(true){ const _newDest = paths.find(path =>..
[LeetCode][JavaScript] 70. Climbing Stairs 문제 출처: https://leetcode.com/problems/climbing-stairs/ Climbing Stairs - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com [직접 푼 코드] var climbStairs = function (n) { if (n < 3) return n; let first = 1; let second = 2; for (let i = 3; i
[LeetCode][JavaScript] 1323. Maximum 69 Number 문제 출처: https://leetcode.com/problems/maximum-69-number/ Maximum 69 Number - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com [직접 푼 코드] var maximum69Number = function(num) { var str = num.toString(); var res = str.replace('6','9'); retur..