Advent of Code 2023 Day 5

AOC-2023-5 If You Give A Seed A Fertilizer This problem was hardest yet and took longest to solve. so the problem asks us to create a map from seed to location such as: seed -> soil -> fertilizer -> water -> light -> temprature -> humidity -> location where we are given certain mappings from one entity to another, eg: seed 1 corresponds to soil 10 and given this mapping and intial seed list we need to find the minimum location....

March 1, 2024 · 2 min · Upendra Upadhyay

Advent of Code 2023 Day 4

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....

February 29, 2024 · 1 min · Upendra Upadhyay

Advent of Code 2023 Day 3

AOC-2023-3 Gear Ratios In this problem, we had to parse the input problem and find all the symbols like: #, *, + and $. All numbers that are adjacent to symbols are important for us, and we need to compute the result. Part 1 In this part we had to compute the sum of numbers adjacent to the symbol decsribed above. To get the results I was going for the graph traversal algorithm, and to do that in haskell I used containers library to get Data....

February 28, 2024 · 1 min · Upendra Upadhyay

Advent of Code 2023 Day 2

AOC-2023-2 Cube Conundrum In this problem, we have to parse the input text and compute the result; this problem was not particularly hard or tricky and just required correct parsing. code for day 2 is at: https://github.com/upendra1997/advent-of-code-2023-hs/blob/main/day2/day2.hs

February 27, 2024 · 1 min · Upendra Upadhyay

Advent of Code 2023 Day 1

AOC-2023-1 Trebuchet?! I have tried solving advent of code 2023 challenges in haskell, and this was my attempt to solve day 1. In this problem we have to find the first and last digits in a line and sum them. problem link: https://adventofcode.com/2023/day/1 Part 1 First part is very simple as it is just a parsing problem, and we can use my favourite library for parsing: parsec to solve it....

February 26, 2024 · 2 min · Upendra Upadhyay