https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph Solution: Disjoint Set Union (DSU) Time Complexity: O() Space Complexity: O() (The input and output generally do not ...
https://leetcode.com/problems/number-of-islands/ Solution: Disjoint Set Union (DSU) Time Complexity: O(len(grid) * len(grid[0])) Space Complexity: O(len(grid) * len(grid[0])) (The input and output gen ...
https://leetcode.com/problems/leaf-similar-trees/ Solution Time Complexity: O(len(tree1 + tree2)) Space Complexity: O(len(tree1 + tree2)) (The input and output generally do not count towards the space ...
NAME := expr Assign to variables within an expression using the notation. 使用例 if Statement sex = 0 if sex == 0: print("boy") ⇒ if (sex := 0) == 0: print("boy") while Statement 例1:讀取檔案 file = open("... ...
Conditionals / Conditional expressions a is None / a is not None a == None / a != None not a (not 0 為 True) Python 中視作 False 的物件 None, False 0 (), [], {}, set(), range(0) In if/while statement if a: ...
https://leetcode.com/problems/validate-binary-search-tree/ Solution Time Complexity: O(len(BST)) Space Complexity: O(len(BST)) (The input and output generally do not count towards the space complexity ...
https://leetcode.com/problems/valid-parentheses/ Solution Time Complexity: O(len(s)) Space Complexity: O(len(s)) (The input and output generally do not count towards the space complexity.) class Solut ...
https://leetcode.com/problems/range-sum-of-bst/ Solution Time Complexity: O(len(tree)) Space Complexity: O(len(tree)) (The input and output generally do not count towards the space complexity.) class ...
常用縮寫 a.k.a. also known as e.g. exempli gratia (拉丁文) 舉例而言, for example i.e. id est (拉丁文) 換句話說, in other words namely 意即 數學用語 iff if and only if, 若且唯若 s.t. such that, 使得 subject to, 受限於 標點符號 「,」: Comma ...
愛情不過是一件普通的玩意 一點也不稀奇 男人不過是一件消遣的東西 有什麼了不起 愛情不過是一件普通的玩意 一點也不稀奇 男人在她的眼裡是消遣的東西 有什麼了不起 愛情不過是一種普通的玩意 一點也不稀奇 男人不過是一件消遣的東西 有什麼了不起 L’amour est enfant de bohême Il n’a jamais, jamais connu de loi Si ...