diff --git a/17.hs b/17.hs index 76775b2..6762f28 100644 --- a/17.hs +++ b/17.hs @@ -11,7 +11,7 @@ postNth n pos list = oneNth :: Int -> Int -> Int -> Int oneNth 50000001 _ oneth = oneth -oneNth n pos oneth = +oneNth n pos !oneth = let !newPos = (pos + steps % n + 1) % n !newOneth = if newPos == 0 then n else oneth in oneNth (n + 1) newPos newOneth diff --git a/README.md b/README.md index c00399b..c6550b6 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,6 @@ These are the runtimes of only one trial but the variances are fairly small and Problems that should be optimized further: 15 -Problems that could use some work: 05, 22, 14, 21 +Problems that could use some work: 05, 22, 14, 21, 17 -Problems that are good enough with optimizations: 17, 13 +Problems that are good enough with optimizations: 13