Dynamic programming for free (Advent of Code 2023 day 12, Haskell)

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

1:52:10 The bug is on the `actual == take (y - 1) expected -> 1` line. It's not checking how much of `lab` is left, so it says that it succeeded even if it didn't use all the labels, in the case where the input ends with a '#'. (Or a ? used as a #.)

Example input in case my explanation isn't clear: "# 1, 1".

The reason adding a . to the end of the input fixes the MultiWayIf version is that it means the condition for the buggy case (input ending in #) is never met.

rogerballard
welcome to shbcf.ru