Gary Lai

105. Construct Binary Tree from Preorder and Inorder Traversal

105. Construct Binary Tree from Preorder and Inorder Traversal 題目給出前序遍歷以及中序遍歷的順序,

337. House Robber III

337. House Robber III 這一題是 198. House Robber 和 213.

83. Remove Duplicates from Sorted List

83. Remove Duplicates from Sorted List 這個題目是快慢指針的題目,慢指針指向的是當前答案的最後一個節點,如果此時快指針指向的節點的值和慢指針指向節點的值相同的時候,代表還有重複值的節點,

211. Design Add and Search Words Data Structure

211. Design Add and Search Words Data Structure 這一題比較特別,需要模糊比對搜尋的字串,

1248. Count Number of Nice Subarrays

1248. Count Number of Nice Subarrays 這題目要求我們找到數組中 總和為 k 的奇數數目

642. Design Search Autocomplete System

642. Design Search Autocomplete System class AutocompleteSystem: def __init__(self,

1268. Search Suggestions System

1268. Search Suggestions System class TrieNode: def __init__(self): self.

536. Construct Binary Tree from String

536. Construct Binary Tree from String 做這題之前可以先完成 606. Construct String

3. Longest Substring Without Repeating Characters

3. Longest Substring Without Repeating Characters 這一題其實是可以透過暴力解法想辦法算出來的,那就是窮舉出所有的子字串,並且檢查每一個子字串有沒有重複的字元。時間複雜度約為

438. Find All Anagrams in a String

483. Find All Anagrams in a String 1. 我們需要想的是窗口增大的時候,需要更新哪些資訊?