[C#] Types
- 2023.08.25
- C#
Value Types & Reference Types Value Types bool, int, float, char … Reference Types Array, String, class… Default Value bool false char ‘\0’ numeric type 0 reference type nu ...
Value Types & Reference Types Value Types bool, int, float, char … Reference Types Array, String, class… Default Value bool false char ‘\0’ numeric type 0 reference type nu ...
Problem len(s3) = len(s1) + len(s2) set(s3) = set(s1) | set(s2) Solution: Backtracking + Memoization 重複子問題的例 s1: “aabcc” s2: “dbbca” s3: “aadbbbaccc” s1: “aa ...
Problem https://leetcode.com/problems/candy-crush Solution one_turn() := find() + crush() + drop() m, n := len(board), len(board[0]) Time Complexity: O(m * n) Space Complexity: O(1) (The input and out ...
Problem https://leetcode.com/problems/text-justification Solution Time Complexity: O(len(words)) Space Complexity: O(1) (The input and output generally do not count towards the space complexity.) clas ...
Problem https://leetcode.com/problems/reverse-string Solution Time Complexity: O(n) Space Complexity: O(1) (The input and output generally do not count towards the space complexity.) class Solution: d ...
Problem https://leetcode.com/problems/reorganize-string n := len(s) k := len(set(s)) find s’ := s'[i] != s[i + 1], i = 0, 1, 2, …, n – 1 Solution Time Complexity: O(n + k * log(k)) ...
Problem https://leetcode.com/problems/excel-sheet-column-title 1 → A 2 → B 3 → C … 26 → Z 27 = 1 * 26 + 1 → AA 28 = 1 * 26 + 2 → AB Solution Time Complexity: O(log(columnNumber)) Space Complexit ...
Problem Counpute len([i for i in range(n) if is_prime(i)]) https://leetcode.com/problems/count-primes First Solution (Time Limit Exceeded) 質數的定義 屬於自然數 ℕ (大於 0 ) 只有兩個正因數 ( 1 和自己) 驗證是否 n 為質數只需要驗證 [2, ⌊n ...
Routing in Flask FLUTTER_DIR = os.path.join(os.sep, ...) @app.route("/app/<path:path>", methods=['GET', 'POST']) def flutter(path): path_ = path.split("/") if len(path) < 2: abort(404) projec ...