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
MR Mystery Box | |
reveal -> MR Character | |
MR Character | |
equip -> |
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
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
var FORMAT_ONELINE = 'One-line'; | |
var FORMAT_MULTILINE = 'Multi-line'; | |
var FORMAT_PRETTY = 'Pretty'; | |
var LANGUAGE_JS = 'JavaScript'; | |
var LANGUAGE_PYTHON = 'Python'; |
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
//SPDX-License-Identifier: Unlicense | |
pragma solidity ^0.7.0; | |
import "@openzeppelin/contracts/utils/Counters.sol"; | |
import "@openzeppelin/contracts/utils/EnumerableSet.sol"; | |
library OfferManager { | |
using EnumerableSet for EnumerableSet.UintSet; | |
using EnumerableSet for EnumerableSet.AddressSet; | |
using Counters for Counters.Counter; |
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 MergeSort() { } | |
MergeSort.prototype.sort = function(values) { | |
if (values.length < 2) { | |
return values; | |
} | |
var mid = Math.floor(values.length/2); | |
var left = this.sort(values.slice(0, mid)); | |
var right = this.sort(values.slice(mid, values.length)); |
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
// LRUCache.js - super simple JavaScript Implementation | |
// LRU stands for "Least Recently Used" | |
// https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU | |
// ----------------------------------------- | |
function LRUNode(key) { | |
this.key = key; | |
this.next = this.prev = null; | |
} |
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
// Trie.js - super simple JS implementation | |
// https://en.wikipedia.org/wiki/Trie | |
// ----------------------------------------- | |
// we start with the TrieNode | |
function TrieNode(key) { | |
// the "key" value will be the character in sequence | |
this.key = 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
// Implement a Graph | |
// basic operations: | |
// - add vertex (node) | |
// - add edge (node -> node) | |
function GraphNode(val) { | |
this.val = val; | |
this.edges = {}; | |
} |
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
// Implement a Queue using LinkedLists | |
// we know that queue is LIFO | |
// operations: enqueue, dequeue | |
function QueueNode(val) { | |
this.val = val; | |
this.next = null; | |
} | |
function Queue() { |
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
// Implement a stack using LinkedLists. | |
// Operations: | |
// -> push | |
// -> pop | |
// -> peek | |
function StackNode(val) { | |
this.val = val; | |
this.next = null; |
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
// Implement a min heap: | |
// -> insert, extract_min | |
// property: | |
// - elements are in ascending order | |
// - complete binary tree (node is smaller than it’s children) | |
// - root is the most minimum | |
// - insert takes O(logn) time | |
// - insert to the bottom right |
NewerOlder