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
#!usr/bin/python | |
from random import randrange, choice | |
from decimal import Decimal | |
from collections import defaultdict | |
from operator import itemgetter | |
import argparse | |
import sys | |
#Global variables | |
name_to_zeroes = { |
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
const requests = new WeakSet(); | |
class Request { | |
constructor() { | |
requests.add(this); | |
} | |
makeRequest() { | |
if(!requests.has(this)) { | |
throw new Error("Invalid access"); |
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
const animals = new Set(["rat", "dog", "cat", "horse", "elephant", "rat", "rat", "cat"]); | |
let animal_iter = animals.keys(); | |
console.log(animal_iter.next()); | |
console.log(animal_iter.next()); | |
console.log(animal_iter.next()); | |
console.log(animal_iter.next()); |
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
const animals = new Set(["rat", "dog", "cat", "horse", "elephant", "rat", "rat", "cat"]); | |
console.log(animals.has("rat")); | |
console.log(animals.has("elephant")); | |
console.log(animals.has("table")); |
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
const animals = new Set(["rat", "dog", "cat", "horse", "elephant", "rat", "rat", "cat"]); | |
console.log(animals.delete("rat")); | |
console.log(animals.delete("rat")); |
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
const animals = new Set(["rat", "dog", "cat", "horse", "elephant", "rat", "rat", "cat"]); | |
console.log(animals.size); | |
animals.clear(); | |
console.log(animals.size); |
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
const animals = new Set(["rat", "dog", "cat", "horse", "elephant", "rat", "rat", "cat"]); | |
let new_set = animals.add("toucan"); | |
console.log(animals === new_set); | |
for (let animal of animals) { | |
console.log(animal); | |
} |
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
const animals = new Set(["rat", "dog", "cat", "horse", "elephant", "rat", "rat", "cat"]); | |
for (let animal of animals) { | |
console.log(animal); | |
} |
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
const animals = new Set(["rat", "dog", "cat", "horse", "elephant", "rat", "rat", "cat"]); | |
console.log(animals.has("rat")); | |
console.log(animals.has("dog")); | |
console.log(animals.has("lion")); |
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
var add = (x, y) | |
=> { | |
var total = x + y; | |
return total; | |
} | |
console.log(add(2, 3)); |
NewerOlder