【LeetCode】解題報告

這篇文章會記錄所有 LeetCode 刷題系列文章。

Top Interview Questions

Array & Strings

Easy

1. Two Sum

7. Reverse Integer

14. Longest Common Prefix

26. Remove Duplicates from Sorted Array

28. Implement strStr()

36. Valid Sudoku

66. Plus One

122. Best Time to Buy and Sell Stock II

125. Valid Palindrome

136. Single Number

217. Contains Duplicate

242. Valid Anagram

283. Move Zeroes

350. Intersection of Two Arrays II

387. First Unique Character in a String

Medium

3. Longest Substring Without Repeating Characters

5. Longest Palindromic Substring

11. Container With Most Water

15. 3Sum

38. Count and Say

48. Rotate Image

49. Group Anagrams

54. Spiral Matrix

73. Set Matrix Zeroes

128. Longest Consecutive Sequence

189. Rotate Array

227. Basic Calculator II

238. Product of Array Except Self

287. Find the Duplicate Number

289. Game of Life

334. Increasing Triplet Subsequence

340. Longest Substring with At Most K Distinct Characters

344. Reverse String

454. 4Sum II

Hard

41. First Missing Positive

76. Minimum Window Substring

239. Sliding Window Maximum

Linked List

Easy

21. Merge Two Sorted Lists

141. Linked List Cycle

160. Intersection of Two Linked Lists

206. Reverse Linked List

234. Palindrome Linked List

237. Delete Node in a Linked List

Medium

2. Add Two Numbers

19. Remove Nth Node From End of List

21. Merge Two Sorted List

138. Copy List with Random Pointer

328. Odd Even Linked List

Hard

23. Merge k Sorted Lists

Trees & Graphs

Easy

94. Binary Tree Inorder Traversal

101. Symmetric Tree

104. Maximum Depth of Binary Tree

108. Convert Sorted Array to Binary Search Tree

Medium

98. Validate Binary Search Tree

102. Binary Tree Level Order Traversal

103. Binary Tree Zigzag Level Order Traversal

116. Populating Next Right Pointers in Each Node

130. Surrounded Regions

200. Number of Islands

207. Course Schedule

210. Course Schedule II

230. Kth Smallest Element in a BST

236. Lowest Common Ancestor of a Binary Tree

547. Number of Provinces

Hard

124. Binary Tree Maximum Path Sum

127. Word Ladder

269. Alien Dictionary

329. Longest Increasing Path in a Matrix

Backtracking

Medium

17. Letter Combinations of a Phone Number

22. Generate Parentheses

46. Permutations

78. Subsets

79. Word Search

131. Palindrome Partitioning

Hard

10. Regular Expression Matching

44. Wildcard Matching

212. Word Search II

301. Remove Invalid Parentheses

Sorting and Searching

Easy

88. Merge Sorted Array

278. First Bad Version

Medium

33. Search in Rotated Sorted Array

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

56. Merge Intervals

75. Sort Colors

162. Find Peak Element

215. Kth Largest Element in an Array

240. Search a 2D Matrix II

253. Meeting Rooms II

347. Top K Frequent Elements

378. Kth Smallest Element in a Sorted Matrix

Hard

Median of Two Sorted Arrays

Dynamic Programming

Easy

53. Maximum Subarray

70. Climbing Stairs

121. Best Time to Buy and Sell Stock

198. House Robber

Medium

55. Jump Game

62. Unique Paths

139. Word Break

152. Maximum Product Subarray

300. Longest Increasing Subsequence

322. Coin Change

Design

Medium

146. LRU Cache

Math

Easy

13. Roman to Integer

50. Pow(x, n)

69. Sqrt(x)

171. Excel Sheet Column Number

172. Factorial Trailing Zeroes

202. Happy Number

204. Count Primes

326. Power of Three

412. Fizz Buzz

Medium

29. Divide Two Integers

Others

Easy

20. Valid Parentheses

118. Pascal’s Triangle

169. Majority Element

202. Happy Number

268. Missing Number

371. Sum of Two Integers

461. Hamming Distance

Medium

150. Evaluate Reverse Polish Notation

Problem Lists

39. Combination Sum

74. Search a 2D Matrix

143. Reorder List

221. Maximal Square

324. Wiggle Sort

362. Design Hit Counter

363. Max Sum of Rectangle No Larger Than K

376. Wiggle Subsequence

416. Partition Equal Subset Sum

437. Path Sum III

525. Contiguous Array

647. Palindromic Substrings

658. Find K Closest Elements

735. Asteroid Collision

815. Bus Routes

916. Word Subsets

973. K Closest Points to Origin

990. Satisfiability of Equality Equations

1074. Number of Submatrices That Sum to Target

1942. The Number of the Smallest Unoccupied Chair

2131. Longest Palindrome by Concatenating Two Letter Words

2415. Reverse Odd Levels of Binary Tree