56. Merge Intervals Solution 1: Sort class Solution: def merge(self, interva...
94. Binary Tree Inorder Traversal Solution 1: Recursive class Solution: def...
189. Rotate Array Solution 1: Insert operation of the array (TLE) class Solution...
62. Unique Paths Solution 1: DFS (TLE) class Solution: def uniquePaths(self,...
234. Palindrome Linked List Solution 1: Auxiliary array & reversed class Sol...
169. Majority Element Solution 1: Counter from collections import Counter class...
45. Jump Game II Solution 0: Brute-Force + DP (看完題目第一個想法) class Solution: de...
139. Word Break Solution 1: DFS (TLE) class Solution: def wordBreak(self, s:...
142. Linked List Cycle II Solution 1: HashSet class Solution: def detectCycl...
239. Sliding Window Maximum (Hard) Solution 1: Brute Force Time Complexity: O()...
34. Find First and Last Position of Element in Sorted Array Solution 1: Recursiv...
105. Construct Binary Tree from Preorder and Inorder Traversal Solution 1: Recur...
124. Binary Tree Maximum Path Sum Solution 1: DFS + Recursive # Definition for a...
98. Validate Binary Search Tree Solution 1: DFS class Solution: def _isValid...
141. Linked List Cycle Solution 1: Hash class Solution: def hasCycle(self, h...
283. Move Zeroes Solution 1: Two Pointers class Solution: def moveZeroes(sel...
41. First Missing Positive Solution 1: Sort class Solution: def firstMissing...
8. String to Integer (atoi) Solution 1: Brute-Force def myAtoi(self, s: str)...
215. Kth Largest Element in an Array Solution 1: Sort class Solution: def fi...
152. Maximum Product Subarray Solution 1: DP class Solution: def maxProduct(...
Shell Sort 是 Insertion Sort 的改良版,加入了間距 (Gap) 的概念將資料分成小區塊,將整組資料分組,每區塊用 Insertion...
6. Zigzag Conversion Solution 1: 2D-Array + Simulation (模擬 Z 字形移動) class Solutio...
25. Reverse Nodes in k-Group Solution 1: Iterative class Solution: def rever...
236. Lowest Common Ancestor of a Binary Tree Solution 1: DFS class Solution:...
148. Sort List Solution 1: Merge Sort # Definition for singly-linked list. # cla...
96. Unique Binary Search Trees Solution 1: DP class Solution: def numTrees(s...
31. Next Permutation Solution 1: Two Pointer class Solution: ""&qu...
78. Subsets Solution 1: Bitwise class Solution(object): def subsets(self, nu...
200. Number of Islands Solution 1: DFS + Bitmap class Solution: def numIslan...
76. Minimum Window Substring Solution 1: Slide Window + Hash from collections im...