From 116aa074b190599e38a43bd6a8602a05cebdfb5d Mon Sep 17 00:00:00 2001 From: bd Date: Mon, 10 Jun 2024 18:13:57 -0600 Subject: AoC 2022.1 p1+2 --- calorie-counting/README.org | 46 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 calorie-counting/README.org (limited to 'calorie-counting/README.org') diff --git a/calorie-counting/README.org b/calorie-counting/README.org new file mode 100644 index 0000000..6d3672f --- /dev/null +++ b/calorie-counting/README.org @@ -0,0 +1,46 @@ +See: https://adventofcode.com/2022/day/1 +** Part 1 +*** Purpose +Given a list of numbers: + +#+begin_example +1000 +2000 +3000 + +4000 + +5000 +6000 + +7000 +8000 +9000 + +10000 +#+end_example + +Calculate the "group" with the largest sum, and report that sum. + +*** Method + +This sounds easy. Split the input into a list of lists: + +#+begin_example +'((1000 + 2000 + 3000) + (4000 + 5000 + 6000) + (7000 + 8000 + 9000) + (10000)) +#+end_example + +Sum up each sub-list, sort it, and take the CAR! + +** Part 2 +*** Purpose +The next part simply asks us to sum the top 3 numbers. So quick and easy, I've just provided the mechanisms for summing X highest numbers. -- cgit v1.2.3