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
import java.util.HashMap; | |
public class Pokemon { | |
String name, type; | |
int maxHP, currentHP; | |
HashMap<String, Integer> moves; | |
public Pokemon(String name, String type, int maxHP){ | |
this.name = name; | |
this.type = type; |
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
[ | |
{ | |
"name": "Mankey", | |
"type": "fighting", | |
"moves": [ | |
{ | |
"name": "low kick", | |
"damage": 10 | |
}, | |
{ |
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
[ | |
{ | |
"name": "Mankey", | |
"type": "fighting", | |
"moves": [ | |
{ | |
"name": "low kick", | |
"damage": 10 | |
}, | |
{ |
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
/* eslint-disable filenames/match-regex, import/no-commonjs */ | |
const path = require('path'); | |
const context = path.resolve(__dirname, 'src'); | |
module.exports = { | |
context, | |
entry: './index.js', | |
module: { | |
rules: [ |
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
const path = require('path'); | |
module.exports = { | |
entry: { | |
app: './src/index.js', | |
}, | |
devtool: 'inline-source-map', | |
output: { | |
path: path.resolve(__dirname, './dist'), | |
filename: 'index.js', |
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
def pair_sum(my_list, target): | |
complements = {} | |
for i in range(len(my_list)): | |
rest = complements.get(my_list[i], None) | |
if rest: | |
return (rest[1], i) | |
complements[target - my_list[i]] = (my_list[i], i) | |
def pair_sum_slow(my_list, target): | |
for i in range(len(my_list)): |
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
def pair_sum(my_list, target): | |
complements = {} | |
for i in range(len(my_list)): | |
rest = complements.get(my_list[i], None) | |
if rest: | |
return (rest[1], i) | |
complements[target - my_list[i]] = (my_list[i], i) | |
def pair_sum_slow(my_list, target): | |
for i in range(len(my_list)): |
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
import requests | |
from bs4 import BeautifulSoup | |
headers = { | |
'User-Agent' : 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.63' | |
} | |
subreddit = input("Enter a sub-reddit name: ").strip().lower() | |
URL = "https://www.reddit.com/r/%s" % subreddit |
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
const { | |
GraphQLObjectType, | |
GraphQLString, | |
GraphQLSchema, | |
GraphQLID, | |
GraphQLInt, | |
GraphQLList, | |
GraphQLNonNull | |
} = require('graphql') |
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
counts = [ 0 for _ in range(26)] | |
for c in input('enter a string: '): | |
counts[ord(c) - 97] += 1 | |
out = "".join([ chr(x+97) + str(y) for x,y in enumerate(counts) if y != 0]) | |
print(out) |