목록2024/07 (32)
넘치게 채우기
https://leetcode.com/problems/filling-bookcase-shelves/?envType=daily-question&envId=2024-07-31leetcode - Filling Bookcase Shelves문제 유형 : 다이나믹 프로그래밍문제 난이도 : Medium 문제You are given an array books where books[i] = [thicknessi, heighti] indicates the thickness and height of the ith book. You are also given an integer shelfWidth.We want to place these books in order onto bookcase shelves that have a..
https://leetcode.com/problems/minimum-deletions-to-make-string-balanced/description/?envType=daily-question&envId=2024-07-30leetcode - Minimum Deletions to Make String Balanced문제 유형 : 다이나믹 프로그래밍문제 난이도 : Medium 문제You are given a string s consisting only of characters 'a' and 'b'.You can delete any number of characters in s to make s balanced. s is balanced if there is no pair of indices (i,j)..
https://leetcode.com/problems/count-number-of-teams/description/?envType=daily-question&envId=2024-07-29leetcode - Count Number of Teams문제 유형 : 투 포인터문제 난이도 : Medium 문제There are n soldiers standing in a line. Each soldier is assigned a unique rating value.You have to form a team of 3 soldiers amongst them under the following rules:Choose 3 soldiers with index (i, j, k) with rating (rating[i], ra..
https://leetcode.com/problems/second-minimum-time-to-reach-destination/description/?envType=daily-question&envId=2024-07-28leetcode - Second Minimum Time to Reach Destination문제 유형 : BFS, 최단서리, 큐문제 난이도 : Hard 문제A city is represented as a bi-directional connected graph with n vertices where each vertex is labeled from 1 to n (inclusive). The edges in the graph are represented as a 2D integer array..
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..