Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
glguy committed Dec 9, 2023
1 parent f4eaea1 commit 1c72106
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions solutions/src/2023/09.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Maintainer : emertens@gmail.com
<https://adventofcode.com/2023/day/9>
Extend an
Interpolate a polynomial sequence to find the next and previous
elements of the sequence.
>>> :{
:main +
Expand All @@ -22,7 +23,7 @@ Extend an
2
-}
module Main where
module Main (main) where

import Advent (format)

Expand All @@ -41,4 +42,4 @@ nextInSequence :: [Int] -> Int
nextInSequence = sum . map last . takeWhile (any (0 /=)) . iterate differences

differences :: [Int] -> [Int]
differences xs = zipWith subtract xs (tail xs)
differences xs = zipWith subtract xs (tail xs)

0 comments on commit 1c72106

Please sign in to comment.