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
# the fuction to find pairs | |
def findPairs(targ,alist): | |
# First, we create a hash table to store our list to shorten the search time. | |
# Here, we use python built-in data structure- dictionary to store key,value pairs, as dictionary is implemented based on hash. | |
d = {} | |
# store result | |
result = [] | |
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
library(RJSONIO) | |
library(plyr) | |
#racechart | |
#Helper functions | |
getNum=function(x){as.numeric(as.character(x))} | |
timeInS=function(tStr){ | |
x=unlist(strsplit(tStr,':')) | |
tS=60*getNum(x[1])+getNum(x[2]) |