Leetcode/LeetCode75 67

[Heap/Priority Queue][Medium] 2462. Total Cost to Hire K Workers

https://leetcode.com/problems/total-cost-to-hire-k-workers/description/ 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 Q. k수의 worker를 고용한다고 할때, costs는 각 worker의 비용이다. 아래와 같은 규칙으로 worker를 고용한다고 할때, k회의 세션 이후 최종 고용비용을 반환하라. ..

Leetcode/LeetCode75 2024.02.18

[Trie][Medium] 1268. Search Suggestions System

https://leetcode.com/problems/search-suggestions-system/description 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 Q. searchWord를 입력함에 따라, products 중에서 이름이 겹치는 순서대로 제시어를 출력하라. 이때 제시어는 최대 3개가 되게 할 것이며, 각 제시어는 lexicorgraphic..

Leetcode/LeetCode75 2024.02.15

[Trie][Medium] 208. Implement Trie (Prefix Tree)

https://leetcode.com/problems/implement-trie-prefix-tree/description 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 Q. Trie class를 insert(), search(), startsWith()와 함께 구현하라. Solution. 우선 Trie 자료 구조에 대해서 좀 정리 해 보자. Trie는 문자..

Leetcode/LeetCode75 2024.02.14

[Graphs-BFS][Medium] 1926. Nearest Exit from Entrance in Maze

https://leetcode.com/problems/nearest-exit-from-entrance-in-maze/description 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 Q. 주어진 maze에서 '.'은 빈칸을, '+'은 벽을 의미한다. entrance에 있다고 가정하면, 출구까지의 최소 이동수를 구하라. 이때 출구는 외부 경계에 위치한 빈칸인..

Leetcode/LeetCode75 2024.02.13

[Graphs-DFS][Medium] 399. Evaluate Division

https://leetcode.com/problems/evaluate-division/description 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 Q. 주어진 수식과 그 식에 해당하는 values가 함께 주어진다. 이때 입력된 queries에 대한 결과를 찾아 출력하라. Solution Graph 카테고리의 좋은 문제. 데이터의 의미를 파악할 줄 알아..

Leetcode/LeetCode75 2024.02.12

[Graphs-DFS][Medium] 547. Number of Provinces

https://leetcode.com/problems/number-of-provinces/description 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 Q. 주어진 vector는 각 노드에 대한 연결 유무를 의미한다. 이때 서로 연결되지 않은 노드 덩어리의 수를 구하라. Solution. 그래프의 기본기를 확인하는 좋은 문제라 할 수 있겠다. 우선 노드..

Leetcode/LeetCode75 2024.02.07

[Graphs - DFS][Medium] 841. Keys and Rooms

https://leetcode.com/problems/keys-and-rooms/description 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 Q. 각 배열안의 숫자는 각 접근 가능한 index를 의미한다. 0 번 index는 접근 가능하다고 할때, 모든 index를 접근 가능한지 여부를 반환하라. Solution tree의 접근법과 거의 같다고 생각하..

Leetcode/LeetCode75 2024.02.07

[Monotonic Stack][Medium] 901. Online Stock Span

https://leetcode.com/problems/online-stock-span/description 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 Q. next()를 통해 그 날의 stock price가 주어진다. 연속해서 이 값보다 같거나 적은 날의 수를 반환하라. Solution. 주어진 모든 input를 list나 vector로 저장한다. 뒤에서..

Leetcode/LeetCode75 2024.02.06

[Monotonic Stack][Medium] 739. Daily Tempreatures

https://leetcode.com/problems/daily-temperatures/description 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 Q. 주어진 배열은 각 날짜의 온도를 의미한다. 각 날짜에서 해당 일보다 더 따뜻한 날을 만나기까지 기다려야 하는 날 수를 출력하라. Solution. 일단 2중 배열을 돌면 해결은 간단해 진다. 하지만 ..

Leetcode/LeetCode75 2024.02.04

[Interval][Medium] 452. Minimum Number of Arrows to Burst Balloons

https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/description 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 Q. 주어진 input을 풍선의 직선에서의 좌표라고 가정한다. 이때 풍선을 모두 떠뜨릴 수 있는 화살의 수를 구하라. 겹쳐진 풍선은 모두 한번에 떠뜨릴 수 있다...

Leetcode/LeetCode75 2024.02.04