AOC-2023-4 Scratchcards

This problem was easy in the sense that it required just required correct parsing and following the rules to get the result in the problem.

Part 1

Part 1 just required correct parsing and computing the solution.

Part 2

Part 2, says that for each winning card with n numbers, we will get extra copies of next n cards, so to maintain the number of extra cards we used a state monad, to keep track of how may extra copies each card have. We use that information to multiply our score with that.


Solution is available at: https://github.com/upendra1997/advent-of-code-2023-hs/blob/main/day4/day4.hs