Part 1: Given a list of running patterns of the form Comet can fly 14 km/s for 10 seconds, but then must rest for 127 seconds.
, determine who will be in the lead after 2503
seconds.
Part 1: Given a list of running patterns of the form Comet can fly 14 km/s for 10 seconds, but then must rest for 127 seconds.
, determine who will be in the lead after 2503
seconds.
Part 1: Given a list of seating preferences of the form Alice would gain 54 happiness units by sitting next to Bob.
find the seating arrangement which maximizes total happiness.
Today at work, I had to process a bunch of CSV data. Realizing that I don’t have any particularly nice tools to work with streaming CSV data (although I did write about querying CSV files with SQL), I decided to write one:
$ cat users.csv
"user_id","name","email","password"
"1","Luke Skywalker","[email protected]","$2b$12$XQ1zDvl5PLS6g.K64H27xewPQMnkELa3LvzFSyay8p9kz0XXHVOFq"
"2","Han Solo","[email protected]","$2b$12$eKJGP.tt9u77PeXgMMFmlOyFWSuRZBUZLvmzuLlrum3vWPoRYgr92"
$ cat users.csv | csv2json | jq '.'
{
"password": "$2b$12$XQ1zDvl5PLS6g.K64H27xewPQMnkELa3LvzFSyay8p9kz0XXHVOFq",
"name": "Luke Skywalker",
"user_id": "1",
"email": "[email protected]"
}
{
"password": "$2b$12$eKJGP.tt9u77PeXgMMFmlOyFWSuRZBUZLvmzuLlrum3vWPoRYgr92",
"name": "Han Solo",
"user_id": "2",
"email": "[email protected]"
}
Part 1: Find the next string in Lexicographical_order that matches these rules:
ghi
)i
, o
, or l
Part 1: Given a list of distances between cities of the form London to Dublin = 464
, calculate the shortest route that visits each city exactly once.
Part 1: Given an escaped string of the form "\xa8br\x8bjr\""
, convert it to the escaped form: br js
. Calculate the total difference of lengths between the former (16
) and the latter (5
).
Part 1: Given a list of definitions of the form 123 -> x
, NOT e -> f
, and x AND y -> z
, with possible operations NOT
, AND
, OR
, LSHIFT
, and RSHIFT
, find the value of a
. Assume all values are 16-bit integers.
Part 1: Given a 1000 by 1000 grid of lights and a list of instructions of the form (turn on|turn off|toggle) 5,10 through 15,20
, determine how many lights are on.