sln_2015_14
Copyright(c) Eric Mertens 2015
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Main

Description

https://adventofcode.com/2015/day/14

>>> :{
:main +
  "time 1000\n\
  \Comet can fly 14 km/s for 10 seconds, but then must rest for 127 seconds.\n\
  \Dancer can fly 16 km/s for 11 seconds, but then must rest for 162 seconds.\n"
:}
1120
689
Synopsis

Documentation

data Reindeer Source #

Constructors

Reindeer 

Fields

main :: IO () Source #

>>> :main
2660
1256

positions :: Reindeer -> [Int] Source #

Compute the position of each reindeer at each second of the race

scores :: [[Int]] -> [Int] Source #

Given a list of race positions return a list of scores

awardPoints Source #

Arguments

:: [Int]

positions

-> [Int]

points

Map each position to 1 point if it's in the lead or 0 otherwise