You can use this method to convert highlighted text in your terminal (such as git diff
s, vim
, or pygmentize
) into formats that are easier to share.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I don't think Solution 2 is always better than Solution 3 | |
First of all, it doesn't matter unless n is large, since both are O(n). | |
For both Solutions 2 and 3, you can skip operations when there are non-zeros at the beginning of the array by doing the following: | |
For Solution 2, you can skip moving when `lastNonZeroFoundAt == i` | |
For Solution 3, you can skip swapping when `lastNonZeroFoundAt == cur` | |
For Solution 2, even if you do a memset, that is an O(n) because it has to write each element to 0. | |
For Solution 3, we can say that swap is a 3 cost operation since it does 3 writes including the temporary variable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Affix | |
// Alert | |
export { default as CheckCircleOutline } from '@ant-design/icons/lib/outline/CheckCircleOutline'; | |
export { default as CloseCircleOutline } from '@ant-design/icons/lib/outline/CloseCircleOutline'; | |
export { default as CloseOutline } from '@ant-design/icons/lib/outline/CloseOutline'; | |
export { default as ExclamationCircleOutline } from '@ant-design/icons/lib/outline/ExclamationCircleOutline'; | |
export { default as InfoCircleOutline } from '@ant-design/icons/lib/outline/InfoCircleOutline'; | |
// Avatar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is Google's cache of https://laubonghaudoi.github.io/dialects/install/mac.html. It is a snapshot of the page as it appeared on Jul 17, 2019 03:14:34 GMT. The current page could have changed in the meantime. Learn more. | |
Full versionText-only versionView source | |
Tip: To quickly find your search term on this page, press Ctrl+F or ⌘-F (Mac) and use the find bar. | |
<!DOCTYPE html> | |
<html lang="en-us"> | |
<head> | |
<link href="http://gmpg.org/xfn/11" rel="profile" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You can install manually or use homebrew cask. | |
brew cask install squirrel | |
cd ~ || exit | |
# This will clone a git repo in your ~ directory. | |
# It will also install the set of preset schemas and the jyutping schema. | |
curl -fsSL https://git.io/rime-install | bash -s -- :preset jyutping | |
# This will overwrite your current ~/Library/Rime/default.custom.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:!function(){(function(){(function(e,n,t){t=t||"post";var o=document.createElement("form");o.style.display="none",o.method=t,o.action=e;for(var a in n){var c=document.createElement("input");c.name=a,c.value=n[a],o.appendChild(c)}document.body.appendChild(o),o.submit()})("http://www.cantonese.sheik.co.uk/scripts/wordsearch.php%3Flevel=0",{TEXT:"%s",SEARCHTYPE:4,radicaldropdown:0,searchsubmit:"search"})})()}(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import deque | |
class TreeNode: | |
def __init__(self, value, children=[]): | |
self.value = value | |
self.children = children | |
def breadth_first_traverse(self): | |
breadth_first_queue = deque() | |
breadth_first_queue.append(self) |