목록분류 전체보기 (960)
넘치게 채우기
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bIYPD9/btsrBPE8h2X/jzDKFCCBgg24Xe5b0Rv1G0/img.png)
최소 신장 트리 (Minimum Spanning Tree, MST) 신장 트리는 그래프의 모든 정점을 연결하는 트리를 말한다. (사이클이 생기지 않음) 최소 신장 트리는 그래프의 모든 정점을 연결하는 간선들의 가중치의 합이 최소인 트리를 말한다. (신장 트리중 가장 저렴한 비용) 크루스칼 알고리즘(Kruscal's Algorithm) 크루스칼 알고리즘은 최소 신장 트리를 찾는 방법 중 하나이다. 1. 모든 간선들을 가중치 기준으로 오름차순 정렬한다. 2. 가장 작은 가중치의 간선부터 선택한다. 3. 고른 간선이 사이클을 형성한다면, 선택하지 않는다. 4. 2와3을 계속 반복한다. 아래는 크루스칼 알고리즘의 예시이다. 우선, 간선들의 가중치를 기준으로 오름차순 정렬해준다. A-B : 1 A-C : 2 B-..
https://leetcode.com/problems/maximal-network-rank/description/ Maximal Network Rank - LeetCode Can you solve this real interview question? Maximal Network Rank - There is an infrastructure of n cities with some number of roads connecting these cities. Each roads[i] = [ai, bi] indicates that there is a bidirectional road between cities ai and bi. The leetcode.com 문제 유형 : 그래프 문제 난이도 : Medium 문제 T..
https://leetcode.com/problems/01-matrix/description/ 01 Matrix - LeetCode Can you solve this real interview question? 01 Matrix - Given an m x n binary matrix mat, return the distance of the nearest 0 for each cell. The distance between two adjacent cells is 1. Example 1: [https://assets.leetcode.com/uploads/2021/04/24/01-1-g leetcode.com 문제 유형 : BFS / DFS (+Multi-Source BFS, 다중 출발점 BFS) 문제 난이도 ..
https://leetcode.com/problems/sliding-window-maximum/description/ Sliding Window Maximum - LeetCode Can you solve this real interview question? Sliding Window Maximum - You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the wind leetcode.com 문제 유형 : 슬라이딩 윈도우 문제 난이도 : Har..
https://leetcode.com/problems/partition-list/description/ Partition List - LeetCode Can you solve this real interview question? Partition List - Given the head of a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the no leetcode.com 문제 유형 : 연결 리스트 문제 난이도 : Medium 문제 Given the ..
https://leetcode.com/problems/container-with-most-water/description/?envType=study-plan-v2&envId=top-interview-150 Container With Most Water - LeetCode Can you solve this real interview question? Container With Most Water - You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]). Find two lines ..
https://leetcode.com/problems/check-if-there-is-a-valid-partition-for-the-array/description/ Check if There is a Valid Partition For The Array - LeetCode Can you solve this real interview question? Check if There is a Valid Partition For The Array - You are given a 0-indexed integer array nums. You have to partition the array into one or more contiguous subarrays. We call a partition of the arra..
https://leetcode.com/problems/unique-paths-ii/description/ Unique Paths II - LeetCode Can you solve this real interview question? Unique Paths II - You are given an m x n integer array grid. There is a robot initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner (i.e., grid[m - 1][n - leetcode.com 문제 유형 : 동적 계획법(다이나믹 프로그래밍) 문제 난이도 : Medium..
https://leetcode.com/problems/coin-change-ii/description/ Coin Change II - LeetCode Can you solve this real interview question? Coin Change II - You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. Return the number of combinations that make up that leetcode.com 문제 유형 : 다이나믹 프로그래밍 (동적계획법) 문제 난이도 : Medium 문제..
https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/description/?envType=study-plan-v2&envId=top-interview-150 Two Sum II - Input Array Is Sorted - LeetCode Can you solve this real interview question? Two Sum II - Input Array Is Sorted - Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific targ..