In VM
sudo adduser ubuntu
sudo su ubuntu
cd /home/ubuntu
mkdir .ssh
chmod 700 .ssh
cd .ssh
import java.util.ArrayList; | |
import java.util.List; | |
class Scratch { | |
class Shark { | |
private final String name = "Sharkie"; | |
public String getName() { return name; } | |
}// A | |
class HammerShark extends Shark{ |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>AlternateMouseScroll</key> | |
<true/> | |
<key>AppleAntiAliasingThreshold</key> | |
<integer>1</integer> | |
<key>AppleScrollAnimationEnabled</key> | |
<integer>0</integer> |
# if not root, find parent, set parent, return parent | |
p = map(chr, range(n)) | |
def find(p, x): | |
if p[x] != x: | |
p[x] = find(p, p[x]) | |
return p[x] | |
def union(p, i, j): | |
pi, pj = find(p, i), find(p, j) |
# if not root, find parent, set parent, return parent | |
p = map(chr, range(n)) | |
def find(p, x): | |
if p[x] != x: | |
p[x] = find(p, p[x]) | |
return p[x] | |
def union(p, i, j): | |
pi, pj = find(p, i), find(p, j) |
# if not root, find parent, set parent, return parent | |
p = map(chr, range(n)) | |
def find(p, x): | |
if p[x] != x: | |
p[x] = find(p, p[x]) | |
return p[x] | |
def union(p, i, j): | |
pi, pj = find(p, i), find(p, j) |
id | difficulty | title | |
---|---|---|---|
253 | Medium | Meeting Rooms II | |
269 | Hard | Alien Dictionary | |
681 | Medium | Next Closest Time | |
159 | Hard | Longest Substring with At Most Two Distinct Characters | |
642 | Hard | Design Search Autocomplete System | |
158 | Hard | Read N Characters Given Read4 II - Call multiple times | |
683 | Hard | K Empty Slots | |
716 | Easy | Max Stack | |
755 | Medium | Pour Water |
from collections import defaultdict | |
class Solution(object): | |
def alienOrder(self, words): | |
""" | |
:type words: List[str] | |
:rtype: str | |
""" | |
graph = defaultdict(list) | |
sudo adduser ubuntu
sudo su ubuntu
cd /home/ubuntu
mkdir .ssh
chmod 700 .ssh
cd .ssh
# . set_gopath.sh | |
export GOPATH=`pwd` | |
export PATH="$GOPATH/bin:$PATH" | |
# for mac osx | |
# export GOBIN=$GOPATH/bin | |
# unset if `flogo build` | |
git config --global --unset alias.gb |
import io | |
import re | |
import sys | |
import collections | |
if len(sys.argv) != 7: | |
print(sys.argv[0] + " <base_dict> <base_lm> <ext_dict> <ext_lm> <merged_dict> <merged_lm>") | |
sys.exit(2) | |
[basedic, baselm, extdic, extlm, outdic, outlm] = sys.argv[1:7] |