summaryrefslogtreecommitdiff
path: root/calorie-counting/README.org
diff options
context:
space:
mode:
Diffstat (limited to 'calorie-counting/README.org')
-rw-r--r--calorie-counting/README.org46
1 files changed, 46 insertions, 0 deletions
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.