Skip to content

Instantly share code, notes, and snippets.

View linanqiu's full-sized avatar

Linan Qiu linanqiu

View GitHub Profile
@linanqiu
linanqiu / script.R
Created June 23, 2021 00:38
Voting for AirBnB
library(vote)
library(tidyverse)
library(googlesheets4)
sheet_url <- 'https://docs.google.com/spreadsheets/d/1NUyFF_BRMpZv0sBGPd88-naOD_XPDv58yZy-OebvfZY/edit#gid=1203714072'
area <- read_sheet(sheet_url, sheet = 'Airbnb Options (Tahoe)', range = 'B9:W21')
area
votes <- area
{
"basics": {
"name": "Linan Qiu",
"email": "linanqiu@gmail.com",
"location": {
"address": "New York, NY"
},
"phone": "(646) 753-1908",
"profiles": [
{

Broker Algo Game

Overview

You're quantitative developers of the renowned hedge fund Principles Capital Management LLC. You're responsible for building systems and algorithms to execute the fund's trades everyday. In order to execute your trades, you engage brokers to do trading on behalf of you. The brokers differ from one another in cost and your job is to incur the lower total trading cost within a given trading session.

Here are the rules:

  • Trading sessions:
  • Each trading session lasts 9 minutes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
package treehack;
import java.util.Comparator;
import java.util.Iterator;
import java.util.TreeSet;
public class RedBlackTree<T> implements Iterable<T> {
// java 8 guarantees that TreeSet uses red black trees
private TreeSet<T> treeSet;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
We can't make this file beautiful and searchable because it's too large.
"","Symbol","Name","IPOyear","Sector","Industry","Exchange","measure","value"
"1","A","Agilent Technologies, Inc.",1999,"Capital Goods","Biotechnology: Laboratory Analytical Instruments","NYSE","LastSale","60.33"
"2","AA","Alcoa Corporation",2016,"Capital Goods","Metal Fabrications","NYSE","LastSale","30.45"
"3","AAC","AAC Holdings, Inc.",2014,"Health Care","Medical Specialities","NYSE","LastSale","6.81"
"4","AAN","Aaron&#39;s, Inc.",NA,"Technology","Diversified Commercial Services","NYSE","LastSale","38.43"
"5","AAP","Advance Auto Parts Inc",NA,"Consumer Services","Other Specialty Stores","NYSE","LastSale","123.58"
"6","AAT","American Assets Trust, Inc.",2011,"Consumer Services","Real Estate Investment Trusts","NYSE","LastSale","39.57"
"7","AAV","Advantage Oil & Gas Ltd",NA,"Energy","Oil & Gas Production","NYSE","LastSale","6.2"
"8","AB","AllianceBernstein Holding L.P.",NA,"Finance","Investment Managers","NYSE","LastSale","23.3"
"9","ABB","ABB Ltd",NA,"Consumer Durables","Electrical Products","NYSE","LastSa