Member-only story
I’m Doing the Advent of Code 2024 in Python — Day 4
Let’s see how many stars we’ll collect.
Welcome to Day 4!
- Day 1 for introduction, how to get the input for your own puzzle, and solutions to the first day’s puzzles.
- Day 2, Day 3
We’ll learn about the following topics in the puzzle for Day 4:
- List comprehension in Python
- How to work with one-dimensional and two-dimensional NumPy arrays
- How to transpose and flip NumPy arrays
As of writing this article, 22 puzzles have been released and each puzzle has two parts. Each part counts for a start and here is my current progress:
Day 4 — Part 1
The puzzle input for Day 4 is a long string that contains the letters X, M, A, and S. The first 10 lines of my puzzle input looks like this: