https://leetcode.com/problems/permutations Solution Time Complexity: O(n * n!) n := len(nums) nums 的排列有 n! 種,每一種的長度皆為 n Space Complexity: O(n) recursion call stack 的最大 depth 為 n output 所使用的空間不計入 space ...
一週心得 「聲帶作動發聲需要的氣息」和「維持 appoggio 需要的氣息」 唱低音時,placement 相對升高 唱母音 i 的方法: 用 u 的嘴形唱 可以適當嘴唇施力露出牙齒增加體感 發聲的位置在聲帶 共鳴的位置在咽喉 發聲練習 唱 a-e-i-o-u 口腔維持同樣的張開,只動舌頭 如果太緊繃的話: 活動上下顎放鬆舌頭 彈舌:唱 1-2-3-2-1
Ref WIKIPEDIA: Catalan Number
https://leetcode.com/problems/all-possible-full-binary-trees Solution n 個節點的 Full Binary Tree 種類數是 C(n – 1) / 2 C(n – 1) / 2 亦是 time complexity 而每一種 Full Binary Tree 都會花費 n 的空間建立 所以 space ...
https://leetcode.com/problems/combinations Solution (Backtracking) \begin{align} &\text{Time Complexity: }O(k \cdot \text{C}^n_k)\\ &\text{Space Complexity: }O(k)\\ \end{align} _combine([1, 2, ...
due to adjective prep. (modifies only pronouns and nouns) ex: His defeat was due to the rain. because of adverb prep. (modifies verbs) ex: He was defeat because of the rain.
受密碼保護的文章不會產生內容摘要。
https://leetcode.com/problems/minimum-ascii-delete-sum-for-two-strings Failed Solution (Time Limit Exceeded) 讓我們來看看這個 solution 的 time complexity O(len(s1) * len(s2) + min(len(s1), len(s2)) * len(s1) * ...
<img style="display: block;" src=... /> #LeftCurlyBrace
https://leetcode.com/problems/strange-printer Solution (DP, Bottom-Top) Dynamic Programming dp[l][r] := The minimum number of operations needed to transform [s[r]] * (r - l + 1) into s[l:r + 1] = if ...