This file contains 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
<?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"> | |
<array> | |
<dict> | |
<key>phrase</key> | |
<string>🀄</string> | |
<key>shortcut</key> | |
<string>:mahjong:</string> | |
</dict> |
This file contains 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
class ListNode: | |
def __init__(self, val): | |
self.val = val | |
self.next = None | |
class LinkedList(object): | |
def __init__(self): | |
""" | |
Initialize your data structure here. |
This file contains 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
import * as React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import './theme.css' | |
export enum Icon { | |
DARK = '🌘', | |
LIGHT = '🌦' | |
} | |
export enum Theme { |
This file contains 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
# x + y = target | |
def twoSum(array, targetSum): | |
seen = {} | |
for index, x in enumerate(array): | |
y = targetSum - x | |
if y in seen: | |
return [x, y] | |
else: | |
seen[x] = index | |
return [] |
This file contains 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
""" | |
Traversing | |
""" | |
class Node: | |
def __init__(self, key): | |
self.left = None | |
self.right = None | |
self.value = key |
This file contains 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
1. SHOW HIDDEN FILES IN FINDER BY DEFAULT: | |
defaults write com.apple.finder AppleShowAllFiles true | |
killall Finder | |
# To switch back, do the same but substitute false for true. | |
# Alternatively you can use CMD + SHIFT + period in a specific Finder folder | |
___________________________________________________________________ |
This file contains 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
""" | |
Example: strOne = dingReviewCo, strTwo = CodingReview | |
Here rotation is after "ReviewCo" | |
Suppose we split strTwo at the rotation point into a and b | |
where a = "Co" and b = "dingReview" | |
Then, strOne would be ba and strTwo would be ab | |
strOne = dingReviewCo = b + a = ding + ReviewCo | |
strTwo = CodingReview = a + b = Co + dingReview |
This file contains 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
class Node: | |
def __init__(self, key): | |
self.left = None | |
self.right = None | |
self.value = key | |
def inOrder(root, visited=[]): | |
if root is not None: | |
inOrder(root.left, visited) |
This file contains 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
function treeHeight(tree) { | |
if (tree === null) return 0; | |
let subHeights = Array.from(tree.children).map(treeHeight) | |
return Math.max(...subHeights, 0) + 1 | |
} | |
// Another option is to traverse DOM layer by layer | |
function treeHeight2(tree) { | |
if (tree === null) return 0; | |
const queue = [tree] |
This file contains 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
{ | |
"openapi": "3.0.1", | |
"info": { | |
"title": "Swagger Petstore", | |
"description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", | |
"termsOfService": "http://swagger.io/terms/", | |
"contact": { | |
"email": "apiteam@swagger.io" | |
}, | |
"license": { |
OlderNewer