Leetcode

Leetcode

Leetcode高頻題解題紀錄

本文將針對Leetcode高頻出現的題目進行解釋以及解題過程,如果準備好這些題目,就足夠應對所有公司的面試了,前提是要每題都用心地去了解它的過程及作法,希望對準備刷題面試的你有所幫助~

1. Two Sum

2. Add Two Numbers

3. Longest Substring Without Repeating Characters

4. Median of Two Sorted Arrays

5. Longest Palindromic Substring

6. Zigzag Conversion

7. Reverse Integer

8. String to Integer (atoi)

9. Palindrome Number

11. Container With Most Water

13. Roman to Integer

14. Longest Common Prefix

15. 3Sum

17. Letter Combinations of a Phone Number

18. 4Sum

19. Remove Nth Node From End of List

20. Valid Parentheses

21. Merge Two Sorted Lists

22. Generate Parentheses

23. Merge k Sorted Lists

24. Swap Nodes in Pairs

26. Remove Duplicates from Sorted Array

27. Remove Element

28. Find the Index of the First Occurrence in a String

32. Longest Valid Parentheses

33. Search in Rotated Sorted Array

34. Find First and Last Position of Element in Sorted Array

35. Search Insert Position

37. Sudoku Solver

41. First Missing Positive

42. Trapping Rain Water

44. Wildcard Matching

46. Permutations

48. Rotate Image

53. Maximum Subarray

56. Merge Intervals

62. Unique Paths

64. Minimum Path Sum

70. Climbing Stairs

72. Edit Distance

75. Sort Colors

78. Subsets

84. Largest Rectangle in Histogram

85. Maximal Rectangle

88. Merge Sorted Array

89. Rotate Array

91. Decode Ways

92. Reverse Linked List II

94. Binary Tree Inorder Traversal

95.Unique Binary Search Trees II

96. Unique Binary Search Trees

98. Validate Binary Search Tree

101. Symmetric Tree

102. binary tree level order traversal

104. Maximum Depth of Binary Tree

105. Construct Binary Tree from Preorder and Inorder Traversal

114. Flatten Binary Tree to Linked List

121. Best Time to Buy and Sell Stock

122. Best Time to Buy and Sell Stock II

124. Binary Tree Maximum Path Sum

136. Single Number

139. Word Break

141. Linked List Cycle

142. Linked List Cycle II

146. LRU Cache

148. Sort List

152. Maximum Product Subarray

160. Intersection of Two Linked Lists

169. Majority Element

198. House Robber

200. Number of Islands

215. Kth Largest Element in an Array

206. Reverse Linked List

226. Invert Binary Tree

234. Palindrome Linked List

236. Lowest Common Ancestor of a Binary Tree

238. Product of Array Except Self

239. Sliding Window Maximum

279. Perfect Squares

283. Move Zeroes

287. Find the Duplicate Number

300. Longest Increasing Subsequence

322. Coin Change

337. House Robber III

416. Partition Equal Subset Sum

437. Path Sum III