這里記錄一下自己刷的LeetCode題目。
有些博客用英文闡述自己的思路和收獲,相當於練習一下英文的表達能力。
比較好的題目有加粗。
題目以后將按題型分類,可以從目錄尋找相關的分類。
數組
簡單題
26. Remove Duplicates from Sorted Array
122. Best Time to Buy and Sell Stock II
136. Single Number (思想很好)
350. Intersection of Two Arrays II
中等題
字符串
簡單題
387. First Unique Character in a String
中等題
8. String to Integer (atoi) 溢出的處理
鏈表
簡單
中等
19. Remove Nth Node From End of List
樹
簡單
104. Maximum Depth of Binary Tree
中等
98. Validate Binary Search Tree(還行)
230. Kth Smallest Element in a BST
94. Binary Tree Inorder Traversal
144. Binary Tree Preorder Traversal
102. Binary Tree Level Order Traversal
困難
145. Binary Tree Postorder Traversal
雙指針類問題
利用雙指針遍歷數組、字符串等。
167. Two Sum II - Input array is sorted
345. Reverse Vowels of a String
棧
待分類
3. Longest Substring Without Repeating Characters
5. Longest Palindromic Substring
151. Reverse Words in a String
157. Read N Characters Given Read4
158. Read N Characters Given Read4 II - Call multiple times
159. Longest Substring with At Most Two Distinct Characters
170. Two Sum III – Data structure design
287. Find the Duplicate Number
557. Reverse Words in a String III