Leetcode 279

[Backtracking][Medium] 22. Generate Parentheses

https://leetcode.com/problems/generate-parentheses/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. n이 주어질때, n 쌍이 되도록 괄호를 open/close 규칙에 맞게 만들어라. Solution. 좋은 문제다. 풀이법을 반드시 숙지하면 좋다. 우선 한번의 문자를 추가할 시 두개의 옵션이 생긴..

[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] 994. Rotting Oranges

https://leetcode.com/problems/rotting-oranges/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. 주어진 grid에서 각 숫자는 다음을 의미한다. 이때 모든 orange가 rotten 상태로 변화는 시간(단계 수)을 구하라. Solution. 위 문제인 지나갈 수 있는 길에서 모든 길에 도달하는 단계 ..

Leetcode/Challenges 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] 1466. Reorder Routes to Make All Paths Lead to the City Zero

https://leetcode.com/problems/reorder-routes-to-make-all-paths-lead-to-the-city-zero/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. n개의 도시수가 있고, 각 도시 노드의 연결 데이터가 주어진다. 이때 어떤 도시에서든, 0 도시에 도달 할 수 있도록, 변경해야 하는 ..

Leetcode/Challenges 2024.02.09

[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