https://leetcode.com/problems/maximum-sum-circular-subarray/ Solution 我們想在「circular array版本的A」中找其maximum sum Subarray 令 B = -A ,只要 A 減去「 B 的maximum sum Subarray」就是答案 注意題目的限制:maximum sum Subarray必須是non ...
https://leetcode.com/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/ Solution 我們使用 min_dq, max_dq 兩個 queue 依照下列步驟去維護min_dq, max_dq: 把 min_dq, max_dq 前方與當前數字 nums[i ...
熱鍵組合 功能說明 Command ⌘ + W 關閉視窗(程式在背景運行) Command ⌘ + Q 關閉程式 Shift ⇧ + Command ⌘ + 「.」 Finder 顯示「.」(dot) 開頭的隱藏[檔案/資料夾]
首先到達 root: / 在 root 你應該會看到主硬碟「Macintosh HD」 按command + j打開顯示方式選項 (view options) 將顯示方式調整好成你喜歡的樣式之後,別忘了按最下方的「做為預設值」 由於每個資料夾都會有一個.DS_Store去存放自己的顯示方式設定 所以我們必須執行下列指令將所有子資料夾的.DS_Store清空 sudo find / -name .D ...
在想要連結的特定位置前後加上<div id="{tag}">和</div> 超連結寫法:<a href={URL}#{tag}>...</a> 意即在原本的 URL 後加上「#{tag}」
Question Many times, we need to re-implement basic functions without using any standard library functions already implemented. For example, when designing a chip that requires very little memory space ...
雖然可能是廢話,pass的作用就是沒有作用, 用來填補尚未寫入任何內容的 function 或 loop
str.join(iterable)或{分隔符}.join({可迭代對象}) 範例 " ".join(["Happy", "Birthday", "to", "You"])⇒"Happy Birthday to You" ".".join(["192", "168", "0", "1"])⇒"192.168.0.1" 用 for 宣告 str 物件 "".join(itertools.chain( ...
isinstance(object, classinfo) 注意是 classinfo 不是 string 範例 isinstance("123", str) – True isinstance("123", int) – False Ref https://docs.python.org/3/library/functions.html#isinstance
Question Given an array of integers arr, you’re asked to calculate for each index i the product of all integers except the integer at that index (i.e. except arr[i]). Implement a function arrayOfArray ...