不用+-, 使用位元運算來計算加總
371. Sum of Two Integers
[LeetCode] 268. Missing Number
找到陣列中跳號的數字
268. Missing Number
[LeetCode] 338. Counting Bits
計算2進位數有幾個1
338. Counting Bits
[LeetCode] 238. Product of Array Except Self
將自己位置以外的元素相乘
238. Product of Array Except Self
[LeetCode] 53. Maximum Subarray
從陣列中找到連續元素數字加總的最大值
53. Maximum Subarray
[LeetCode] 152. Maximum Product Subarray
從陣列中找到連續元素數字乘積的最大值
152. Maximum Product Subarray
[LeetCode] 153. Find Minimum in Rotated Sorted Array
題目會你已排序的陣列, 該陣列給你之前, 會取前面某一段移到陣列最後, 你在該陣列找到最小值, 以最小的比對次數完成此搜尋
153. Find Minimum in Rotated Sorted Array
[LeetCode] 33. Search in Rotated Sorted Array
題目會你已排序的陣列, 該陣列給你之前, 會取前面某一段移到陣列最後, 你在該陣列找到目標值, 以最小的比對次數完成此搜尋
33. Search in Rotated Sorted Array
[LeetCode] 15. 3Sum
列出所有加總=0的3個元素組合, 各組合不可重覆
15. 3Sum
[LeetCode] 11. Container With Most Water
計算直方圖圍成的最大面積
11. Container With Most Water
[LeetCode] 217. Contains Duplicate
只要陣列有2個數字一樣就回傳true
217. Contains Duplicate
[LeetCode] 202. Happy Number
判斷是否為快樂數字
202. Happy Number
[LeetCode] 191. Number of 1 Bits
計算2進位有幾個1
191. Number of 1 Bits
[LeetCode] 190. Reverse Bits
將2進位數字反轉
190. Reverse Bits
[LeetCode] 185. Department Top Three Salaries
查出每個部門前3名資料
185. Department Top Three Salaries
[LeetCode] 171. Excel Sheet Column Number
判斷Excel欄位名是第幾個欄位
171. Excel Sheet Column Number
[LeetCode] 169. Majority Element
找出陣列中出現最多次的數字
169. Majority Element
[LeetCode] 168. Excel Sheet Column Title
欄位數轉成excel的欄位名
168. Excel Sheet Column Title
[LeetCode] 160. Intersection of Two Linked Lists
找到2個LinedList第一個共同ListNode
160. Intersection of Two Linked Lists
[LeetCode] 1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree
檢查是否為循環的Linked List
141. Linked List Cycle
[LeetCode] 125. Valid Palindrome
檢查檢查數字英文正反向是否相同, 忽略其它符號
125. Valid Palindrome
[LeetCode] 121. Best Time to Buy and Sell Stock
計算一元素減它之前元素, 找出最大值
121. Best Time to Buy and Sell Stock
[LeetCode] 119. Pascal's Triangle II
和[LeetCode] 118. Pascal's Triangle幾乎一樣, 只要回傳最後List即可
119. Pascal's Triangle II
[LeetCode] 118. Pascal's Triangle
如圖所示, 給n行, 每行元素數遞增, 元素值為上一陣列2個鄰近元素相加Taiwan is a country. 臺灣是我的國家
118. Pascal's Triangle
[LeetCode] 88. Merge Sorted Array
將2個已排序陣列合併成一個排序陣列
88. Merge Sorted Array
[LeetCode] 83. Remove Duplicates from Sorted List
移除已排序陣列中重復的項目
83. Remove Duplicates from Sorted List
[LeetCode] 70. Climbing Stairs
計算n階梯若走1步或2步時, 有幾種走法
70. Climbing Stairs
[LeetCode] 95. Unique Binary Search Trees II
和96題一樣題目, 結果是回傳所有可能的TreeNode
Unique Binary Search Trees II
[LeetCode] 96. Unique Binary Search Trees
找出1~n可組成幾種BST
Unique Binary Search Trees
[LeetCode] 69. Sqrt(x)
手動開根號
69. Sqrt(x)
[LeetCode] 67. Add Binary
將2進位字串作加總
67. Add Binary
[LeetCode] 66. Plus One
陣列最後一元素加1, 但若>9要進位到前一元素, 如同十進位數字一樣
66. Plus One
[LeetCode] 58. Length of Last Word
回傳最後一字的字數
58. Length of Last Word
[LeetCode] 35. Search Insert Position
找到一個數字可插入至已排序陣列的位置回傳
35. Search Insert Position
[LeetCode] 27. Remove Element
將陣列內指定的元素移除, 後面的元素往前推
27. Remove Element
[LeetCode] 21. Merge Two Sorted Lists
給2個已排序陣列, 合併成一個排序陣列
[LeetCode] 26. Remove Duplicates from Sorted Array
將已排序陣列, 計算共幾個不重覆的數目, 不用改陣列長度, 只要把陣列前面不重覆數字再次寫入即可
26. Remove Duplicates from Sorted Array
[LeetCode] 109. Convert Sorted List to Binary Search Tree
將SortedList轉成符合BST的TreeNode
Convert Sorted List to Binary Search Tree
[LeetCode] 106. Construct Binary Tree from Inorder and Postorder Traversal
由postorder 和inorder反推, 作出原本的TreeNode回傳
Construct Binary Tree from Inorder and Postorder Traversal
[LeetCode] 2236. Root Equals Sum of Children
固定一個root配左右腳, 若是左右腳加總等於root回傳true, 否則false
Root Equals Sum of Children
[LeetCode] 105. Construct Binary Tree from Preorder and Inorder Traversal
由preorder和inorder反推, 作出原本的TreeNode回傳
Construct Binary Tree from Preorder and Inorder Traversal
[LeetCode] 99. Recover Binary Search Tree
把TreeNode依BST原則將數字放到正確位置
Recover Binary Search Tree
[LeetCode] 559. Maximum Depth of N-ary Tree
[LeetCode] 589. N-ary Tree Preorder Traversal
每層由左而右往下找, 依序由最淺那個Node先列入list回傳
N-ary Tree Postorder Traversal
[LeetCode] 590. N-ary Tree Postorder Traversal
每層由左而右往下找, 依序由最深那個Node先列入list回傳
Evaluate Boolean Binary Tree
[LeetCode] 2331. Evaluate Boolean Binary Tree
左右腳值以上一層node指示計算, 回傳最後結果
Evaluate Boolean Binary Tree
[LeetCode] 1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree
給2個一模一樣的TreeNode, 和隨機一個original內的一node當作target, 找出cloned內另一個一樣的的回傳
Find a Corresponding Node of a Binary Tree in a Clone of That Tree
[LeetCode] 222. Count Complete Tree Nodes
計算有幾個NodeTaiwan is a country. 臺灣是我的國家
[LeetCode] 199. Binary Tree Right Side View
依序抓每層最右邊的值
[LeetCode] 20. Valid Parentheses
傳入一串字, 只有[]{}()這6種字元, 檢核左括弧是否都有合理的右括弧