feat(sterni/aoc/2021): day 15 solution

Change-Id: Idca2ae2829a7ee9e856aa7fcdc716c3055051062
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4363
Reviewed-by: sterni <sternenseemann@systemli.org>
Autosubmit: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
This commit is contained in:
sterni 2021-12-16 13:40:12 +01:00 committed by clbot
parent 0357dd973b
commit 01f4212ca1

View file

@ -278,3 +278,38 @@ ElementRarityDiff ← {
•Out "Day 14.1: "•Fmt ElementRarityDiff 10
•Out "Day 14.2: "•Fmt ElementRarityDiff 40
#
# 2021-12-15
#
day15ExampleInput >
1163751742
1381373672
2136511328
3694931569
7463417111
1319128137
1359912421
3125421639
1293138521
2311944581
day15Input '0'-˜ (())ReadInput 15
LowestRiskLevel {
start 0˙ () 𝕩
ir (1𝕩)
Step {𝕩 𝕨 + (ir«ir»«˘»˘) 𝕩}
𝕩Step _fix start
}
! 40 = LowestRiskLevel day15ExampleInput
•Out "Day 15.1: "•Fmt LowestRiskLevel day15Input
FiveByFiveMap {(9|)(-1) (<𝕩)+ +˜5}
! 315 = LowestRiskLevel FiveByFiveMap day15ExampleInput
•Out "Day 15.2: "•Fmt LowestRiskLevel FiveByFiveMap day15Input