這裏記錄一下本身刷的LeetCode題目。html
有些博客用英文闡述本身的思路和收穫,至關於練習一下英文的表達能力。數組
比較好的題目有加粗。post
題目之後將按題型分類,能夠從目錄尋找相關的分類。 指針
簡單題htm
26. Remove Duplicates from Sorted Arrayblog
122. Best Time to Buy and Sell Stock IIip
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