일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Python
- 리트코드
- HashTable
- string
- Depth-first Search
- matrix
- DP
- hash table
- sorting
- 재귀
- leetcode
- linked list
- 이진트리
- Medium
- recursive
- binary tree
- list
- Array
- easy
- 미디움
- 문자열
- two pointers
- Binary
- backtracking
- 쉬움
- binary search
- 중간
- math
- dfs
- tree
- Today
- Total
목록Array (32)
부부의 코딩 성장 일기
1. 문제 링크 https://leetcode.com/problems/3sum-closest/ LeetCode - The World's Leading Online Programming Learning Platform 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 2. 문제 설명 리스트 nums와 target 수가 주어졌을 때 nums에서 서로 다른 세 개를 더하여 만들 수 있는 값 중 target과 가장 가까운 값을 반환 예시) nums = [-1,2,1,-4], target..
1. 문제 링크 https://leetcode.com/problems/majority-element/ Majority Element - LeetCode Can you solve this real interview question? Majority Element - Given an array nums of size n, return the majority element. The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element always exists leetcode.com 2. 문제 설명 크기가 n인 배열이 주어졌을 때, majority element를 반환..
1. 문제 링크 https://leetcode.com/problems/single-number/ Single Number - LeetCode Can you solve this real interview question? Single Number - Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. You must implement a solution with a linear runtime complexity and use only constant leetcode.com 2. 문제 설명 정수로 구성된 nums가 주어졌을 때, 한 element만을 제외하곤, 모든 e..

1. 문제 링크 https://leetcode.com/problems/pascals-triangle-ii/ Pascal's Triangle II - LeetCode Can you solve this real interview question? Pascal's Triangle II - Given an integer rowIndex, return the rowIndexth (0-indexed) row of the Pascal's triangle. In Pascal's triangle, each number is the sum of the two numbers directly above it as shown: [https leetcode.com 2. 문제 설명 rowIndex 라는 정수가 주어졌을 때, Pas..
1. 문제 링크 https://leetcode.com/problems/merge-sorted-array/ 2. 문제 설명 오름차순 정수로 구성된 두 array nums1, nums2와, 각 array의 개수를 m,n이라고 할 때, nums1, nums2를 오름차순 순서로 merge한 list를 반환 전제조건 "in-place" return하는 list는 nums1에 store해야 하며, 결과적으로 nums의 길이는 m+n이 됨 예시1) nums1 = [1,2,3,0,0,0] m=3, nums2 = [2,5,6] n= 3 → [1,2,2,3,5,6] 반환 예시2) nums1 = [1] m=1, nums2 = [] n= 0 → [1] 반환 3. 처음 풀이 nums1의 m+1~m+n 자리에 nums2 elem..
1. 문제 링크 Search Insert Position - LeetCode Search Insert Position - LeetCode Can you solve this real interview question? Search Insert Position - Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You must w leetcode.com 2. 문제 설명 정수가 오름차순으로 정렬된 리스트와 하나의 정수가 주어졌을 때 정수를 리스트에..
1. 문제 링크 https://leetcode.com/problems/remove-duplicates-from-sorted-array/ 2. 문제 설명 이번엔 좋아요(13K)보다 싫어요(17.2K)가 더 많지만 그럼에도 상위에 있는 문제 오름차순으로 sort된 nums라는 배열이 있을 때, 중복이 없도록 array를 쌓고, unique 배열의 가장 마지막 index를 반환. 간단해보이지만, 전제조건이 "in-place"로, 기존의 데이터 구조를 변경하지 않고 정렬 또는 변환 작업을 수행해야 함 예시1) nums = [1,1,2] 일 때, nums = [1,2,_]로 변환하고, 2의 index인 1를 반환 예시2) nums = [0,0,1,1,1,2,2,2,3,3,4] 일 때, nums = [0,1,2,3..
1. 문제 링크 Remove Element - LeetCode Remove Element - LeetCode Can you solve this real interview question? Remove Element - Given an integer array nums and an integer val, remove all occurrences of val in nums in-place [https://en.wikipedia.org/wiki/In-place_algorithm]. The order of the elements may be changed. Then r leetcode.com 2. 문제 설명 int가 담긴 리스트 nums와 int인 val이 주어졌을 때, nums에서 val은 모두 제외하고 남은..