diff options
author | H.J <thechairman@thechairman.info> | 2024-10-09 11:36:55 -0400 |
---|---|---|
committer | H.J <thechairman@thechairman.info> | 2024-10-09 11:36:55 -0400 |
commit | 8777ff071f7bb37631baa7b6717ad29961e50911 (patch) | |
tree | 6d59c4ed58e454b960339c3d1151f0a879e8d7cb /codingquest2024/src/day8/solution.gleam | |
parent | 6156a9ef7be4012063a042aafb4e9b0d7eadde8e (diff) | |
download | gleam_aoc-8777ff071f7bb37631baa7b6717ad29961e50911.tar.gz gleam_aoc-8777ff071f7bb37631baa7b6717ad29961e50911.zip |
sorting by language
Diffstat (limited to 'codingquest2024/src/day8/solution.gleam')
-rw-r--r-- | codingquest2024/src/day8/solution.gleam | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/codingquest2024/src/day8/solution.gleam b/codingquest2024/src/day8/solution.gleam deleted file mode 100644 index cb4d907..0000000 --- a/codingquest2024/src/day8/solution.gleam +++ /dev/null @@ -1,26 +0,0 @@ -import gleam/io -import gleam/int -import gleam/list -import utilities/memo - -const options = [40, 12, 2, 1] - -const distance = 856 - -pub fn main() { - use cache <- memo.create() - solve(distance, cache) - |> io.debug -} - -fn solve(target, cache) { - use <- memo.memoize(cache, target) - case target { - 0 -> 1 - _ -> - options - |> list.filter(fn(n) { n <= target }) - |> list.map(fn(n) { solve(target - n, cache) }) - |> int.sum - } -} |