week12 {swjungle}{ALGORITHMS}
README
์๊ณ ๋ฆฌ์ฆ ์ฃผ์ฐจ, leet code ๋ฌธ์ ๋ฅผ ํผ๋ค. ๋๋ ์๋น๊ตฐ์ ๋ค๋ ์์ ๋ชฉ, ๊ธ ์ค์ํ ํ ์คํธ๋ฅผ ์ค์ํ์ง ๋ชปํ๋ค. ๊ทธ๋๋ ์ข์ ๋ฌธ์ ๋ค์ด๊ธฐ ๋๋ฌธ์ ๋ฐ๋์ ํ์ด๋ณด๋ ์๊ฐ์ ๊ฐ์ ธ๋ณด์. ํ ์๊ฐ ์์ ๋ค ํ์ด์ผ ํ๋ค.
weekly contests & bi-weekly contests
2023-10-28 ์ฝ์น๋์ ์ ์:
Leetcode weekly ํน์ bi-weekly์ ์ฐธ๊ฐํด ๋ณด๊ธฐ๋ฅผ ๊ถ์ฅํฉ๋๋ค.
๋งค์ฃผ ์ผ์์ผ 11:30 ~ 13:00 (KST) ์ Leetcode weekly contest๊ฐ ์ด๋ฆฝ๋๋ค. (4๋ฌธ์ ์ถ์ )
๋ํ 2์ฃผ์ ํ๋ฒ์ฉ ์ง๊ตฌ ๋ฐ๋ํธ ์ฌ๋๋ค์ ์๊ฐ์ ๋ง์ถ์ด ํ ์์ผ 23:30 ~ 25:00 (๊ทธ ๋ค์๋ 01:00)๋ bi-weekly contest๊ฐ ์ด๋ฆฝ๋๋ค.
๋ง์นจ ์ค๋ ์ ๋ 11์ ๋ฐ์ bi-weekly contest 116์ด, ๋ด์ผ ์ค์ 11์ ๋ฐ์ weekly contest 369๊ฐ ์ด๋ฆฝ๋๋ค.1์๊ฐ 30๋ถ๋์ ์ต์ ์ ๋คํด ๋ฌธ์ ๋ฅผ ํ๊ณ ๋ด ์ค๋ ฅ์ด ์ด๋ ์ ๋์ธ์ง Ranking์ ํตํด ํ์ธํด ๋ณด์๊ณ
๋๋ ์ด๋ ๊ฒ ํ์๋๋ฐ ๋ค๋ฅธ ์ฌ๋๋ค์ ์ด๋ป๊ฒ ํ์๋์ง ๋ค๋ฅธ ์ฌ๋๋ค์ ์ฝ๋๋ฅผ ๋ณด๊ณ ๋น๊ตํด ๋ณด์๋ ๊ฒ๋ ์ข์ต๋๋ค.
ํ์ฌ ๋์ ์ฝ๋ฉ ์ค๋ ฅ์ด ์ด๋ ์ ๋์ธ์ง ๊ฐ๊ดํ ํ๋๋ฐ ๋์์ด ๋ ๊ฒ์ด๋ผ ๋ด ๋๋ค.
TEST01
- 2475. Number of Unequal Triplets in Array
- 2476. Closest Nodes Queries in a Binary Search Tree {์ฝ๋ฉํธ ์์}
TEST02
- ํ์: 2733. Neither Minimum nor Maximum
- ์ ํ: 1481. Least Number of Unique Integers after K Removals
- ์ ํ: 1482. Minimum Number of Days to Make m Bouquets
TEST03
- 2215. Find the Difference of Two Arrays
- 2259. Remove Digit From Number to Maximize Result
- 2260. Minimum Consecutive Cards to Pick Up
- 2211. Count Collisions on a Road
TEST04
- find-winner-on-a-tic-tac-toe-game
- minimum-time-visiting-all-points
- count-servers-that-communicate
- search-suggestions-system
๋ฌธ์ ๋ชฉ๋ก
# | ๋ฌธ์ ๋ฒํธ | ๋์ด๋ | ๋ค๋ฃจ๋ ์ฃผ์ | ๋ฌธ์ ์ ๋ชฉ | ํ์ด์ฌ๋ถ |
---|---|---|---|---|---|
1 | 1 | Easy | Hash Table | Two Sum | โ |
2 | 15 | Medium | Two pointer, Sorting | 3 Sum {leetcode} | โ |
3 | 9 | Easy | Math | Palindrome Number | โ |
4 | 7 | Medium | Math | Reverse Integer | โ |
5 | 412 | Easy | String | Fizz Buzz | โ |
6 | 14 | Easy | String, Trie | Longest Common Prefix | |
7 | 20 | Easy | Stack | Valid Parenthesis | |
8 | 42 | Hard | Stack | Trapping Rain Water | |
9 | 456 | Medium | Stack, Ordered Set | 132 Pattern | |
10 | 22 | Medium | Backtracking, DP | Generate Parentheses | |
11 | 52 | Hard | Backtracking | N-Queens II | |
12 | 282 | Hard | Backtracking | Expression Add Operators | |
13 | 56 | Medium | Sorting | Merge Intervals | |
14 | 3 | Medium | Sliding Window | Longest Substring Without Repeating Characters | |
15 | 560 | Medium | Prefix Sum | Subarray Sum Equals K | |
16 | 34 | Medium | Binary Search | Find First and Last Position of Element in Sorted Array | |
17 | 215 | Medium | Sorting, Priority Queue, Quickselect | Kth Largest Element in an Array | |
18 | 209 | Medium | Binary Search, Sliding Window | Minimum Size Subarray Sum | |
19 | 218 | Hard | Priority Queue, Segment Tree | The Skyline Problem | |
20 | 200 | Medium | Graph | Number of Islands | |
21 | 399 | Medium | Graph | Evaluate Division | |
22 | 207 | Medium | Graph | Course Schedule | |
23 | 486 | Medium | Game Theory | Predict the Winner | |
24 | 121 | Easy | DP | Best Time to Buy and Sell Stock | |
25 | 70 | Easy | DP | Climbing Stairs | |
26 | 300 | Medium | Binary Search, DP | Longest Increasing Subsequence | |
27 | 5 | Medium | DP | Longest Palindromic Substring | |
28 | 11 | Medium | Greedy | Container With Most Water | |
29 | 1235 | Hard | Binary Search, DP, Priority Queue | Maximum Profit in Job Scheduling | |
30 | 847 | Hard | Graph, DP | Shortest Path Visiting All Nodes |
์๋ฃ๊ตฌ์กฐ/์๊ณ ๋ฆฌ์ฆ ์ค์ - 100๋ฌธ์
# | ์ถ์ฒ | ๋ฌธ์ ๋ฒํธ | ๋์ด๋ | ์ฃผ์ | ๋น๊ณ | ๋ฌธ์ ์ ๋ชฉ |
1 | ๋ฐฑ์ค | 11653 | ํ | ๊ธฐ์ด | ์์ธ์๋ถํด | |
2 | ๋ฐฑ์ค | 11720 | ํ | ๊ธฐ์ด | ๋ฌธ์์ด | ์ซ์์ ํฉ |
3 | ๋ฐฑ์ค | 11816 | ํ | ๊ธฐ์ด | 8์ง์, 10์ง์, 16์ง์ | |
4 | ๋ฐฑ์ค | 8595 | ์ค | ๊ธฐ์ด | ๋ฌธ์์ด | ํ๋ ๋๋ฒ |
5 | ๋ฐฑ์ค | 1269 | ํ | ์ ๋ ฌ | ๋์นญ ์ฐจ์งํฉ | |
6 | ๋ฐฑ์ค | 11728 | ํ | ์ ๋ ฌ | ๋ฐฐ์ด ํฉ์น๊ธฐ | |
7 | ๋ฐฑ์ค | 1406 | ์ค | ์คํ | ์๋ํฐ | |
8 | ๋ฐฑ์ค | 9935 | ์ค | ์คํ | ๋ฌธ์์ด ํญ๋ฐ | |
9 | ๋ฐฑ์ค | 2231 | ํ | ์์ ํ์ | ๋ถํดํฉ | |
10 | ๋ฐฑ์ค | 2798 | ํ | ์์ ํ์ | ๋ธ๋์ญ | |
11 | ๋ฐฑ์ค | 1062 | ์ค | ์์ ํ์ | ๊ฐ๋ฅด์นจ | |
12 | ๋ฐฑ์ค | 10974 | ์ค | ์์ ํ์ | ๋ชจ๋ ์์ด | |
13 | ๋ฐฑ์ค | 6603 | ์ค | ์์ ํ์ | DFS๋ก๋ ๊ฐ๋ฅ | ๋ก๋ |
14 | ๋ฐฑ์ค | 10815 | ํ | ์ด๋ถ ํ์ | ์ซ์ ์นด๋ | |
15 | ๋ฐฑ์ค | 2343 | ์ค | ์ด๋ถ ํ์ | ๊ธฐํ ๋ ์จ | |
16 | ๋ฐฑ์ค | 1654 | ์ค | ์ด๋ถ ํ์ | ๋์ ์๋ฅด๊ธฐ | |
17 | ๋ฐฑ์ค | 1300 | ์ | ์ด๋ถ ํ์ | K๋ฒ์งธ ์ | |
18 | ๋ฐฑ์ค | 2447 | ํ | ๋ถํ ์ ๋ณต | ๋ณ ์ฐ๊ธฐ | |
19 | ๋ฐฑ์ค | 2339 | ์ค | ๋ถํ ์ ๋ณต | ์ํ ์๋ฅด๊ธฐ | |
20 | ๋ฐฑ์ค | 13430 | ์ | ๋ถํ ์ ๋ณต | ํฉ ๊ตฌํ๊ธฐ | |
21 | ๋ฐฑ์ค | 1493 | ์ | ๋ถํ ์ ๋ณต | ๋ฐ์ค ์ฑ์ฐ๊ธฐ | |
22 | ๋ฐฑ์ค | 1517 | ์ | ๋ถํ ์ ๋ณต | ๋ฒ๋ธ ์ํธ | |
23 | ๋ฐฑ์ค | 2606 | ํ | ๊ทธ๋ํ | BFS/DFS | ๋ฐ์ด๋ฌ์ค |
24 | ๋ฐฑ์ค | 1303 | ํ | ๊ทธ๋ํ | BFS/DFS | ์ ์ - ์ ํฌ |
25 | ๋ฐฑ์ค | 1963 | ์ค | ๊ทธ๋ํ | BFS/DFS | ์์ ๊ฒฝ๋ก |
26 | ๋ฐฑ์ค | 14226 | ์ค | ๊ทธ๋ํ | BFS/DFS | ์ด๋ชจํฐ์ฝ |
27 | ๋ฐฑ์ค | 2206 | ์ | ๊ทธ๋ํ | BFS/DFS | ๋ฒฝ ๋ถ์๊ณ ์ด๋ํ๊ธฐ |
28 | ๋ฐฑ์ค | 16930 | ์ | ๊ทธ๋ํ | BFS/DFS | ๋ฌ๋ฆฌ๊ธฐ |
29 | ๋ฐฑ์ค | 1516 | ์ค | ๊ทธ๋ํ | ์์ ์ ๋ ฌ | ๊ฒ์ ๊ฐ๋ฐ |
30 | ๋ฐฑ์ค | 3665 | ์ค | ๊ทธ๋ํ | ์์ ์ ๋ ฌ | ์ต์ข ์์ |
31 | ๋ฐฑ์ค | 1753 | ์ค | ๊ทธ๋ํ | ๋ค์ต์คํธ๋ผ | ์ต๋จ๊ฒฝ๋ก |
32 | ๋ฐฑ์ค | 5719 | ์ค | ๊ทธ๋ํ | ๋ค์ต์คํธ๋ผ | ๊ฑฐ์ ์ต๋จ ๊ฒฝ๋ก |
33 | ๋ฐฑ์ค | 10217 | ์ | ๊ทธ๋ํ | ๋ค์ต์คํธ๋ผ | KCM Travel |
34 | ๋ฐฑ์ค | 11657 | ์ | ๊ทธ๋ํ | ๋ฒจ๋ง-ํฌ๋ | ํ์๋จธ์ |
35 | ๋ฐฑ์ค | 11404 | ์ | ๊ทธ๋ํ | ํ๋ก์ด๋-์์ | ํ๋ก์ด๋ |
36 | ๋ฐฑ์ค | 1922 | ์ค | ๊ทธ๋ํ | MST | ๋คํธ์ํฌ ์ฐ๊ฒฐ |
37 | ๋ฐฑ์ค | 2887 | ์ค | ๊ทธ๋ํ | MST | ํ์ฑ ํฐ๋ |
38 | ๋ฐฑ์ค | 9373 | ์ | ๊ทธ๋ํ | MST | ๋ณต๋ ๋ซ๊ธฐ |
39 | ๋ฐฑ์ค | 6086 | ์ | ๊ทธ๋ํ | ๋คํธ์ํฌ ์ ๋ | ์ต๋ ์ ๋ |
40 | ๋ฐฑ์ค | 17412 | ์ | ๊ทธ๋ํ | ๋คํธ์ํฌ ์ ๋ | ๋์ ์๋ณตํ๊ธฐ 1 |
41 | ๋ฐฑ์ค | 2188 | ์ | ๊ทธ๋ํ | ๋คํธ์ํฌ ์ ๋ (์ด๋ถ ๋งค์นญ) | ์ถ์ฌ ๋ฐฐ์ |
42 | ๋ฐฑ์ค | 1932 | ํ | DP | ์ ์ ์ผ๊ฐํ | |
43 | ๋ฐฑ์ค | 2293 | ํ | DP | ๋์ 1 | |
44 | ๋ฐฑ์ค | 13398 | ์ค | DP | ์ฐ์ํฉ 2 | |
45 | ๋ฐฑ์ค | 2643 | ์ค | DP | ์์ข ์ด ์ฌ๋ ค ๋๊ธฐ | |
46 | ๋ฐฑ์ค | 2482 | ์ค | DP | ์์ํ | |
47 | ๋ฐฑ์ค | 1695 | ์ค | DP | ํฐ๋ฆฐ๋๋กฌ ๋ง๋ค๊ธฐ | |
48 | ๋ฐฑ์ค | 1562 | ์ค | DP | ๊ณ๋จ ์ | |
49 | ๋ฐฑ์ค | 1965 | ์ค | DP | ์์๋ฃ๊ธฐ | |
50 | ๋ฐฑ์ค | 1958 | ์ค | DP | LCS 3 | |
51 | ๋ฐฑ์ค | 7476 | ์ | DP | ์ต๋ ๊ณตํต ์ฆ๊ฐ ์์ด | |
52 | ๋ฐฑ์ค | 1315 | ์ | DP | RPG | |
53 | ๋ฐฑ์ค | 2533 | ์ค | DP | Tree DP | ์ฌํ๋ง ์๋น์ค(SNS) |
54 | ๋ฐฑ์ค | 1693 | ์ | DP | Tree DP | ํธ๋ฆฌ ์์น ํ๊ธฐ |
55 | ๋ฐฑ์ค | 17365 | ์ | DP | Tree DP (Trie ์๋ฃ๊ตฌ์กฐ) | ๋ณ๋ค์ค |
56 | ๋ฐฑ์ค | 10162 | ํ | ๊ทธ๋ฆฌ๋ | ์ ์๋ ์ธ์ง | |
57 | ๋ฐฑ์ค | 2212 | ํ | ๊ทธ๋ฆฌ๋ | ์ผ์ | |
58 | ๋ฐฑ์ค | 1911 | ์ค | ๊ทธ๋ฆฌ๋ | ํ๊ธธ ๋ณด์ํ๊ธฐ | |
59 | ๋ฐฑ์ค | 8980 | ์ค | ๊ทธ๋ฆฌ๋ | ํ๋ฐฐ | |
60 | ๋ฐฑ์ค | 2529 | ์ค | ๊ทธ๋ฆฌ๋ | ๋ถ๋ฑํธ | |
61 | ๋ฐฑ์ค | 2217 | ์ค | ๊ทธ๋ฆฌ๋ | ๋กํ | |
62 | ๋ฐฑ์ค | 3109 | ์ | ๊ทธ๋ฆฌ๋ | ๋นต์ง | |
63 | ๋ฐฑ์ค | 4716 | ์ | ๊ทธ๋ฆฌ๋ | ํ์ | |
64 | ๋ฐฑ์ค | 14499 | ํ | ์ผ์ฑ SW ์ญ๋ ํ ์คํธ | ์ฃผ์ฌ์ ๊ตด๋ฆฌ๊ธฐ | |
65 | ๋ฐฑ์ค | 3190 | ์ค | ์ผ์ฑ SW ์ญ๋ ํ ์คํธ | ๋ฑ | |
66 | ๋ฐฑ์ค | 14503 | ์ค | ์ผ์ฑ SW ์ญ๋ ํ ์คํธ | ๋ก๋ด ์ฒญ์๊ธฐ | |
67 | ๋ฐฑ์ค | 16234 | ์ค | ์ผ์ฑ SW ์ญ๋ ํ ์คํธ | ์ธ๊ตฌ ์ด๋ | |
68 | ๋ฐฑ์ค | 5373 | ์ค | ์ผ์ฑ SW ์ญ๋ ํ ์คํธ | ํ๋น | |
69 | ๋ฐฑ์ค | 15684 | ์ค | ์ผ์ฑ SW ์ญ๋ ํ ์คํธ | ์ฌ๋ค๋ฆฌ ์กฐ์ | |
70 | ๋ฐฑ์ค | 17472 | ์ค | ์ผ์ฑ SW ์ญ๋ ํ ์คํธ | ๋ค๋ฆฌ ๋ง๋ค๊ธฐ 2 | |
71 | ๋ฐฑ์ค | 14791 | ์ค | Google Code Jam | Tidy Numbers (Large) | |
72 | ๋ฐฑ์ค | 14382 | ํ | ์ซ์์ธ๋ ์ (Large) | ||
73 | ๋ฐฑ์ค | 14798 | ์ค | Google Code Jam | Alphabet Cake (Large) | |
74 | ๋ฐฑ์ค | 14806 | ์ค | Google Code Jam | Stable Neigh-bors (Large) | |
75 | ๋ฐฑ์ค | 14810 | ์ค | Google Code Jam | Ample Syrup (Large) | |
76 | ๋ฐฑ์ค | 15958 | ์ | ์นด์นด์ค ์ฝ๋ ํ์คํฐ๋ฒ | ํ๋ก๋์ 100์ผ ์ค๋น | |
77 | ๋ฐฑ์ค | 15998 | ์ค | ์นด์นด์ค ์ฝ๋ ํ์คํฐ๋ฒ | ์นด์นด์ค๋จธ๋ | |
78 | ๋ฐฑ์ค | 15999 | ์ | ์นด์นด์ค ์ฝ๋ ํ์คํฐ๋ฒ | ๋ค์ง๊ธฐ | |
79 | ๋ฐฑ์ค | 16000 | ์ค | ์นด์นด์ค ์ฝ๋ ํ์คํฐ๋ฒ | ์ฌ | |
80 | ๋ฐฑ์ค | 16002 | ์ | ์นด์นด์ค ์ฝ๋ ํ์คํฐ๋ฒ | ์กฐ์ฉํ ์ํ๊ด ๋ง๋ค๊ธฐ | |
81 | Leetcode | 367 | ํ | ๊ธฐ์ด | Valid Perfect Square | |
82 | Leetcode | 166 | ์ค | ๊ธฐ์ด | Fraction to Recurring Decimal | |
83 | Leetcode | 274 | ์ค | ์ ๋ ฌ | H-Index | |
84 | Leetcode | 110 | ํ | ์ฌ๊ทํจ์ | Balanced Binary Tree | |
85 | Leetcode | 726 | ์ | ์ฌ๊ทํจ์ | ๋ฌธ์์ด | Number of Atoms |
86 | Leetcode | 53 | ํ | ๋ถํ ์ ๋ณต | Maximum Subarray | |
87 | Leetcode | 4 | ์ | ๋ถํ ์ ๋ณต | Median of Two Sorted Arrays | |
88 | Leetcode | 232 | ํ | ์คํ, ํ | Implement Queue using Stacks | |
89 | Leetcode | 101 | ํ | ๊ทธ๋ํ | BFS/DFS | Symmetric Tree |
90 | Leetcode | 130 | ์ค | ๊ทธ๋ํ | BFS/DFS | Surrounded Regions |
91 | Leetcode | 301 | ์ | ๊ทธ๋ํ | BFS/DFS | Remove Invalid Parentheses |
92 | Leetcode | 785 | ์ค | ๊ทธ๋ํ | BFS/DFS | Is Graph Bipartite? |
93 | Leetcode | 864 | ์ | ๊ทธ๋ํ | BFS/DFS (๋ค์ต์คํธ๋ผ) | Shortest Path to Get All Keys |
94 | Leetcode | 746 | ํ | DP | Min Cost Climbing Stairs | |
95 | Leetcode | 213 | ์ค | DP | House Robber II | |
96 | Leetcode | 85 | ์ | DP | Maximal Rectangle | |
97 | Leetcode | 10 | ์ | DP | Regular Expression Matching | |
98 | Leetcode | 124 | ์ | DP | Binary Tree Maximum Path Sum | |
99 | Leetcode | 55 | ์ค | ๊ทธ๋ฆฌ๋ | Jump Game | |
100 | Leetcode | 757 | ์ | ๊ทธ๋ฆฌ๋ | Set Intersection Size At Least Two |