X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;ds=sidebyside;f=src%2Fadvent14%2Fadvent14.hs;h=9f642bcc523474f4a577db214b816ab5fa511ede;hb=f0f3f60ddd5a2b1b130c3ff4bb9e602382ebbaf2;hp=9a219e119aa0d862c2c82b4fe5b69ab714b07b77;hpb=92b8d2e9bb05d589a794e45bc52c63ec19fa1da0;p=advent-of-code-18.git diff --git a/src/advent14/advent14.hs b/src/advent14/advent14.hs index 9a219e1..9f642bc 100644 --- a/src/advent14/advent14.hs +++ b/src/advent14/advent14.hs @@ -1,6 +1,5 @@ import qualified Data.Sequence as Q -import Data.Sequence ((<|), (|>)) -import Data.List +import Data.Sequence ((|>)) import Data.Foldable (toList) type Recipes = Q.Seq Int @@ -26,8 +25,6 @@ part2 :: State -> Int part2 state0 = if (takeR (Q.length targetSeq) recipes) == targetSeq then (Q.length recipes) - (Q.length targetSeq) else (Q.length recipes) - (Q.length targetSeq) - 1 --- recipes -- (Q.length recipes) - (Q.length targetSeq) - where (State _ _ recipes) = head $ dropWhile (unfinished2 targetSeq) $ states state0 unfinished2 :: Recipes -> State -> Bool