목록PS/LeetCode (591)
넘치게 채우기
https://leetcode.com/problems/minimum-cost-to-convert-string-i/description/?envType=daily-question&envId=2024-07-27leetcode - Minimum Cost to Convert String I문제 유형 : 문자열 처리, 최단거리, bfs문제 난이도 : Medium 문제You are given two 0-indexed strings source and target, both of length n and consisting of lowercase English letters. You are also given two 0-indexed character arrays original and changed, and an i..
https://leetcode.com/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/description/leetcode - Find the City With the Smallest Number of Neighbors at a Threshold Distance문제 유형 : 최단거리, 다익스트라, bfs문제 난이도 : Medium 문제There are n cities numbered from 0 to n-1. Given the array edges where edges[i] = [fromi, toi, weighti] represents a bidirectional and weighted edge bet..
https://leetcode.com/problems/sort-an-array/description/leetcode - Sort an Array문제 유형 : 정렬, 투포인터문제 난이도 : Medium 문제Given an array of integers nums, sort the array in ascending order and return it.You must solve the problem without using any built-in functions in O(nlog(n)) time complexity and with the smallest space complexity possible. 정수 배열 nums가 주어진다. 오름차순으로 순서를 정렬하고 반환하시오.아무런 built-in 함수도 사용하..
https://leetcode.com/problems/sort-the-jumbled-numbers/description/leetcode - Sort the Jumbled Numbers문제 유형 : 정렬, 해시문제 난이도 : Medium 문제You are given a 0-indexed integer array mapping which represents the mapping rule of a shuffled decimal system. mapping[i] = j means digit i should be mapped to digit j in this system.The mapped value of an integer is the new integer obtained by replacing each occ..
https://leetcode.com/problems/sort-array-by-increasing-frequency/description/leetcode - Sort Array by Increasing Frequency문제 유형 : 정렬문제 난이도 : Easy 문제Given an array of integers nums, sort the array in increasing order based on the frequency of the values. If multiple values have the same frequency, sort them in decreasing order.Return the sorted array. 정수 배열 nums가 주어진다. 배열을 수가 나오는 빈도에 따라 오름차순 정렬하라..
https://leetcode.com/problems/sort-the-people/description/leetcode - Sort the People문제 유형 : 정렬, 우선순위 큐문제 난이도 : Easy 문제You are given an array of strings names, and an array heights that consists of distinct positive integers. Both arrays are of length n.For each index i, names[i] and heights[i] denote the name and height of the ith person.Return names sorted in descending order by the people's he..

https://leetcode.com/problems/build-a-matrix-with-conditions/description/leetcode - Build a Matrix With Conditions문제 유형 : 행렬, 위상 정렬문제 난이도 : Hard 문제You are given a positive integer k. You are also given:a 2D integer array rowConditions of size n where rowConditions[i] = [abovei, belowi], anda 2D integer array colConditions of size m where colConditions[i] = [lefti, righti].The two arrays contain ..
https://leetcode.com/problems/find-valid-matrix-given-row-and-column-sums/description/leetcode - Find Valid Matrix Given Row and Column Sums문제 유형 : 그리디, 행렬문제 난이도 : Medium 문제You are given two arrays rowSum and colSum of non-negative integers where rowSum[i] is the sum of the elements in the ith row and colSum[j] is the sum of the elements of the jth column of a 2D matrix. In other words, you do n..
https://leetcode.com/problems/lucky-numbers-in-a-matrix/description/leetcode - Lucky Numbers in a Matrix문제 유형 : 행렬문제 난이도 : Easy 문제Given an m x n matrix of distinct numbers, return all lucky numbers in the matrix in any order.A lucky number is an element of the matrix such that it is the minimum element in its row and maximum in its column. m x n의 행렬이 주어진다.럭키넘버들을 찾아서 반환하시오. 순서는 상관없습니다. 럭키넘버는 한 행에..
https://leetcode.com/problems/number-of-good-leaf-nodes-pairs/description/leetcode - Number of Good Leaf Nodes Paris문제 유형 : 이진트리, 재귀문제 난이도 : Medium 문제You are given the root of a binary tree and an integer distance. A pair of two different leaf nodes of a binary tree is said to be good if the length of the shortest path between them is less than or equal to distance.Return the number of good leaf..