# F#

## Advent of Code F# – Day 25

ps. look out for all my other solutions for Advent of Code challenges here.   Day 25 See details of the challenge here. Today’s input looks like this: cpy a d cpy 7 c cpy 362 b inc d dec b jnz b -2 … At last, we’re at the end of this year’s Advent of …

## Advent of Code F# – Day 24

ps. look out for all my other solutions for Advent of Code challenges here.   Day 24 See details of the challenge here. Today’s challenge is a mix of Breadth-First Search (or Level Order Tree Traversal) and the Travelling Salesman Problem. First, let’s parse the input file into a 2D array to make it easier for …

## Advent of Code F# – Day 23

ps. look out for all my other solutions for Advent of Code challenges here.   Day 23 See details of the challenge here. Today’s input looks like this: cpy a b dec b cpy a d cpy 0 a cpy b c inc a .. Today’s challenge is an extension to Day 12, where we have …

## Advent of Code F# – Day 22

ps. look out for all my other solutions for Advent of Code challenges here.   Day 22 See details of the challenge here. Today’s input looks like this: root@ebhq-gridcenter# df -h Filesystem                           Size    Used     Avail    Use% /dev/grid/node-x0-y0     …

## Advent of Code F# – Day 21

ps. look out for all my other solutions for Advent of Code challenges here.   Day 21 See details of the challenge here. Today’s input looks like this: swap position 2 with position 7 swap letter f with letter a swap letter c with letter a rotate based on position of letter g rotate based on …

## Advent of Code F# – Day 20

ps. look out for all my other solutions for Advent of Code challenges here.   Day 20 See details of the challenge here. Today’s input looks like this: 1873924193-1879728099 2042754084-2076891856 4112318198-4113899685 1039794493-1057170966 3791841434-3797494664 1518668516-1518748952 1946127596-1953926346 4058215215-4086224696 3429681642-3455096313 2599576643-2604275147 1800210010-1801990849 1761160149-1766904471 2774395403-2774748831 1520470679-1542287000 2343327790-2346083217 … First, let’s read the input into a list of tuples representing the …

## Advent of Code F# – Day 19

ps. look out for all my other solutions for Advent of Code challenges here.   Day 19 See details of the challenge here. I initially approached today’s challenge as a dynamic programming exercise, but it quickly transpired that there’s a much better way to do it once I realised that part 1 is in fact the …

## Advent of Code F# – Day 18

ps. look out for all my other solutions for Advent of Code challenges here.   Day 18 See details of the challenge here. To solve both part 1 and 2:   Links Day 18 challenge description Advent of Code 2015 Solution for Day 17 All my F# solutions for Advent of Code Github repo

## Advent of Code F# – Day 17

ps. look out for all my other solutions for Advent of Code challenges here.   Day 17 See details of the challenge here. First, let’s add a hash function (that returns the MD5 as a hexadecimal string as we have done so often this year). Then, add a step function that’ll take a (x, y) position and the path …

## Advent of Code F# – Day 16

ps. look out for all my other solutions for Advent of Code challenges here.   Day 16 See details of the challenge here. I also tried an implememtation using string instead of bool[] and there is no distinguishable difference in terms of performance. Now that we have the solve function we can answer both part 1 …