---
# System prepended metadata

title: Leetcode 學習筆記
tags: [Leetcode]

---

# LeetCode 學習筆記
- [前言](/Vol8OVKqSGKKcbOCxO1CNQ)


## 最近更新



## Grind 75
- [1. Two Sum](/x91vDhFJQumSSdzAMScmmQ)
- [3. Longest Substring Without Repeating Characters](/s-3RPRARTZyE1WDSCPbEow)
- [5. Longest Palindromic Substring](/WNlwh1ymR5G1-nX0nsMp-A)
- [383. Ransom Note](/EMWOgSsGTxK3WUnwa9SKSA)
- [8. String to Integer (atoi)](/J6OnSqhNRK6zSbEq2F6NhA)
- [11. Container With Most Water](/trgyhkbvRGS0x8dyTfZe8g)
- [139. Word Break](/jEhdHb7CQn6LHq7q9I1lNg)
- [141. Linked List Cycle](/xK6xxciCTr-BTOoTPUNc1Q)
- [994. Rotting Oranges](/Wj-7GQMXRUOTwvFsmmxmfA)
- [17. Letter Combinations of a Phone Number](/fx94JbxbQR2eo56FE0kC_w)
- [20. Valid Parentheses](/bMHq5CFGRSuikYZIO02mvA)
- [409. Longest Palindrome](/3EuInRa5S32Xy0NkXkgCnA)
- [322. Coin Change](/ZkVLggr0QiCqHp4S59s3cw)
- [125. Valid Palindrome](/406c01ovRZWxp6bl_iQWBA)


## NeetCode 150
- [1. Two Sum](/x91vDhFJQumSSdzAMScmmQ)
- [2. Add Two Numbers](/n9_JInKXS-efy5mecqiHzQ)
- [3. Longest Substring Without Repeating Characters](/s-3RPRARTZyE1WDSCPbEow)
- [5. Longest Palindromic Substring](/WNlwh1ymR5G1-nX0nsMp-A)
- [7. Reverse Integer](/kpQ7hmY4SDasSU92andGcA)
- [11. Container With Most Water](/trgyhkbvRGS0x8dyTfZe8g)
- [994. Rotting Oranges](/Wj-7GQMXRUOTwvFsmmxmfA)
- [17. Letter Combinations of a Phone Number](/fx94JbxbQR2eo56FE0kC_w)
- [20. Valid Parentheses](/bMHq5CFGRSuikYZIO02mvA)
- [66. Plus One](/YPSR-vkSSLq9S_JyZwfkIg)
- [70. Climbing Stairs](/VAFNmb6rRbuvxIsyfzT7TQ)
- [125. Valid Palindrome](/406c01ovRZWxp6bl_iQWBA)
- [139. Word Break](/jEhdHb7CQn6LHq7q9I1lNg)
- [141. Linked List Cycle](/xK6xxciCTr-BTOoTPUNc1Q)
- [238. Product of Array Except Self](/YkAXCRwfSG65ap85ZUELOg)
- [704. Binary Search](/5_cRDxq6QFy5lVyi0TNvug)
- [322. Coin Change](/ZkVLggr0QiCqHp4S59s3cw)


## LeetCode 75
### Array / String
- [1768. Merge Strings Alternately](/S3-B0sEUTByiGEwX8xRwKg)
- [1071. Greatest Common Divisor of Strings](/sfO_0eRCQOyNbrezVUXW4g)
- [1431. Kids With the Greatest Number of Candies](/SqYgehJJRsGt8FBEACUrig)
- [605. Can Place Flowers](/QMvPRedNRFCB2WpnxK1oIw)
- [345. Reverse Vowels of a String](/nE0GlUa3Q6-NVgc3uuLZCA)
- [151. Reverse Words in a String](/jxprJcHLSMmYqxe_WHSmQA)
- [238. Product of Array Except Self](/YkAXCRwfSG65ap85ZUELOg)
- [334. Increasing Triplet Subsequence](/bDxTN3IgSBeGpA2Ovdd3fA)
- [443. String Compression](/G4iPehCgSs2nTI--GJTLIg)


### Two Pointers
- [283. Move Zeroes](/wibnb6pKQN2JqqwqXCEVqQ)
- [392. Is Subsequence](/tBn1Kx9kRH6Kb8IMiPNCSA)
- [11. Container With Most Water](/trgyhkbvRGS0x8dyTfZe8g)
- [1679. Max Number of K-Sum Pairs](/A89uMaXGRSWNuyrMBiSwww)


### Sliding Window
- [643. Maximum Average Subarray I](/jpNAQ5EkSD-EP-0TA12XNQ)
- [1456. Maximum Number of Vowels in a Substring of Given Length](/G0dk1bInTXmJccxeYj5ECQ)
- [1004. Max Consecutive Ones III](/i1Ax_iivQXSuFZh_HxRpZg)
- [1493. Longest Subarray of 1's After Deleting One Element](/u-NoR4_aSI-pGvPvgjS59w)


### Prefix Sum
- [1732. Find the Highest Altitude](/Rv0hQ2YOR-uLk9KOZlNmDA)
- [724. Find Pivot Index](/2z4nFERUTM6Ges9TRt8bXA)


### Hash Map / Set
- [2215. Find the Difference of Two Arrays](/a2U3HYbERqqvUW-jkj0Z_g)
- [1207. Unique Number of Occurrences](/OYuv3-YTQcituDVbfEZdKw)
- [1657. Determine if Two Strings Are Close](/84CyuLq5Q3aDK8AHHt-9SQ)
- [2352. Equal Row and Column Pairs](/rWoKMNBcSyOTIFlllhqo3w)


### Stack
- [2390. Removing Stars From a String](/zPmiEThYTUGhdcuo64keTg)
- [735. Asteroid Collision](/rJYpyj93RDmuAFkypSXaQA)
- [394. Decode String](/8-z0-LmZRdam_111eIX_JA)


### Queue
- [933. Number of Recent Calls](/UIZaOhBoRRG4o5bjpFSz5Q)
- [649. Dota2 Senate](/vrh4bpK9SWa8mdsNwQnqTw)


### Linked List
- [2095. Delete the Middle Node of a Linked List](/IZ471NvWR1WzOnugct7bqA)
- [328. Odd Even Linked List](/wHjZu6RmTUWUZtpIel-zDw)
- [206. Reverse Linked List](/JIECJF9gQR6A-yoMXhcptg)
- [2130. Maximum Twin Sum of a Linked List](/GQLmiUumRD6C5dLnye7iiA)


### Binary Tree - DFS
- [104. Maximum Depth of Binary Tree](/B-QbOscXQkyYYaaUjSyZGA)
- [872. Leaf-Similar Trees](/E3CAjsNXQLWpFGh40ezWDw)


### Graphs - BFS
- [994. Rotting Oranges](/Wj-7GQMXRUOTwvFsmmxmfA)


### Backtracking
- [17. Letter Combinations of a Phone Number](/fx94JbxbQR2eo56FE0kC_w)


## Top Interview 150
### Array / String
- [88. Merge Sorted Array](/EgUEAz21RxKVGdoZZUlKug)
- [27. Remove Element](/g22alA9nTT-aTVIpveX2Eg)
- [26. Remove Duplicates from Sorted Array](/XcQwYhiOQZWpqtvzrBmvBA)
- [80. Remove Duplicates from Sorted Array II](/JDNhwZqoTDq56MPVQmfc0w)
- [169. Majority Element](/XSy0kG0tS9iKrDC5zbYsQw)
- [189. Rotate Array](/7mdd1WZcR6KAFg6fXiTx4w)
- [238. Product of Array Except Self](/YkAXCRwfSG65ap85ZUELOg)
- [151. Reverse Words in a String](/jxprJcHLSMmYqxe_WHSmQA)
- [6. Zigzag Conversion](/Y7T95LD-T_KIkMK1F7U1tA)
- [28. Find the Index of the First Occurrence in a String](/r6Xt90v_Q-uBmryc9tijlA)

### Two Pointers
- [125. Valid Palindrome](/406c01ovRZWxp6bl_iQWBA)
- [392. Is Subsequence](/tBn1Kx9kRH6Kb8IMiPNCSA)
- [11. Container With Most Water](/trgyhkbvRGS0x8dyTfZe8g)

### Sliding Window
- [3. Longest Substring Without Repeating Characters](/s-3RPRARTZyE1WDSCPbEow)

### Hashmap
- [383. Ransom Note](/EMWOgSsGTxK3WUnwa9SKSA)
- [1. Two Sum](/x91vDhFJQumSSdzAMScmmQ)

### Stack
- [20. Valid Parentheses](/bMHq5CFGRSuikYZIO02mvA)

### Backtracking
- [17. Letter Combinations of a Phone Number](/fx94JbxbQR2eo56FE0kC_w)

### Math
- [66. Plus One](/YPSR-vkSSLq9S_JyZwfkIg)

### 1D DP
- [70. Climbing Stairs](/VAFNmb6rRbuvxIsyfzT7TQ)
- [139. Word Break](/jEhdHb7CQn6LHq7q9I1lNg)

### Multidimensional DP
- [5. Longest Palindromic Substring](/WNlwh1ymR5G1-nX0nsMp-A)


## Others
- [9. Palindrome Number](/pPtJrZdzTjK7ee874cAG1A)
- [13. Roman to Integer](/3tQipee0QxGUs1pwRzQ6LQ)
- [29. Divide Two Integers](/ybuEyjXGQSCeTzldT2qWQw)
- [110. Balanced Binary Tree](/RGDfVIk3RzKBsxfq6depWQ)
- [231. Power of Two](/PtTgjm2dR8GS8RGVRhrtFQ)
- [326. Power of Three](/Nv8ERwHAT6yUyGV6NbnbmQ)
- [342. Power of Four](/EbBusZFhTSGQvQvGq7MoOg)
- [520. Detect Capital](/OdTWybwdTmisiaMYjqrMxA)
- [744. Find Smallest Letter Greater Than Target](/c5fNsIIIRn--PA65eWIsyg)
- [796. Rotate String](/UmLdrekcRMyP7iVM7EGqSw)
- [1200. Minimum Absolute Difference](/aMUSVVNdRX2vUizZx3gjFA)
- [1266. Minimum Time Visiting All Points](/dhnyG7WKQvaqxxcXbRouZA)
- [1344. Angle Between Hands of a Clock](/4vzbRCPIQqq51AWOdnbuzg)
- [1653. Minimum Deletions to Make String Balanced](/9G-nm5FcT8K23AJUwbPbRQ)
- [1877. Minimize Maximum Pair Sum in Array](/EEvtCpNBQO66soetOwql7A)
- [2124. Check if All A's Appears Before All B's](/J-em73flTmCpcYLOKVefww)
- [3010. Divide an Array Into Subarrays With Minimum Cost I](/omKvblbjTSqAtnu4bSHsKQ)
- [3314. Construct the Minimum Bitwise Array I](/h-go9DCAQi6vg4qivsx0wg)
- [3379. Transformed Array](/A8Dop7ZeTS233Wy6BobtcQ)
- [3507. Minimum Pair Removal to Sort Array I](/HlLW5X7DTqS8VTWtC_Huww)
- [3634. Minimum Removals to Balance Array](/rRFdyPo7QjuIhE5UDsRMWw)
- [3637. Trionic Array I](/Y1plNQt8QyWct6JHQkIkSw)
- [3640. Trionic Array II](/1wp-GI3uTGOaKIV1O03Ngw)


## Biweekly Contest 174
- [Q1. Best Reachable Tower](/7DfGPqBeRkmXXUXVJkxaKA)
- [Q2. Minimum Operations to Reach Target Array](/cE1S9_1fQ4OSk-GkeWmECQ)


## Weekly Contest 485
- [Q1. Vowel-Consonant Score](/oQZppbajSQqOb8qLt5-uSA)
- [Q2. Maximum Capacity Within Budget](/tqc5Z5clTey2NQOn0whb-g)
- [Q3. Design Auction System](/TFegUdUCRyyL8BNFdueAeQ)


## Weekly Contest 486
- [Q1. Minimum Prefix Removal to Make Array Strictly Increasing](/y_qu69wDSUik_2TsDR05eA)
- [Q2. Rotate Non-Negative Elements](/QR5cnMQ4T0eTLuOmALXLPQ)
- [Q4. Find Nth Smallest Integer with K One Bits](/sECWk2uGQyGCImvh0SdXuw)


## Biweekly Contest 175
- [Q1. Reverse Letters Then Special Characters in a String](/0SPxS6MkRey6_it0a3IYvg)
- [Q2. Minimum K to Reduce Array Within Limit](/razx35fuQ3-aQ42dALaclg)


## Weekly Contest 487
- [Q1. Count Monobit Integers](/gvhpU3qzSgC8FBtkoRXDsg)
- [Q2. Final Element After Subarray Deletions](/vl7obK6zS2eMEpba5Vc7Fw)
- [Q3. Design Ride Sharing System](/wkUFR16HRme9Km3qXRO4tg)
- [Q4. Longest Alternating Subarray After Removing At Most One Element](/pZl0T3EoSHOOsgwKFQSVAQ)


## Weekly Contest 488
- [Q1. Count Dominant Indices](/ZwSlPx0NQMWCYUz1-Vyz9g)
- [Q2. Merge Adjacent Equal Elements](/Ucg_xDemT_e1wfS089QJ-g)