Skip to content

Commit

Permalink
add part 2 readme
Browse files Browse the repository at this point in the history
  • Loading branch information
NullDev committed Dec 7, 2024
1 parent 5a18f37 commit cc28d93
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions 2024/Day_07/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,21 @@ Only three of the above equations can be made true by inserting operators:
The engineers just need the **total calibration result**, which is the sum of the test values from just the equations that could possibly be true. In the above example, the sum of the test values for the three equations listed above is **`3749`**.

Determine which equations could possibly be true. **What is their total calibration result?**

---

## --- Part Two ---

The engineers seem concerned; the total calibration result you gave them is nowhere close to being within safety tolerances. Just then, you spot your mistake: some well-hidden elephants are holding a **third type of operator**.

The [concatenation](https://en.wikipedia.org/wiki/Concatenation) operator (`||`) combines the digits from its left and right inputs into a single number. For example, `12 || 345` would become `12345`. All operators are still evaluated left-to-right.

Now, apart from the three equations that could be made true using only addition and multiplication, the above example has three more equations that can be made true by inserting operators:

- `156: 15 6` can be made true through a single concatenation: `15 || 6 = 156`.
- `7290: 6 8 6 15` can be made true using `6 * 8 || 6 * 15`.
- `192: 17 8 14` can be made true using `17 || 8 + 14`.

Adding up all six test values (the three that could be made before using only `+` and `*` plus the new three that can now be made by also using `||`) produces the new **total calibration result** of **`11387`**.

Using your new knowledge of elephant hiding spots, determine which equations could possibly be true. **What is their total calibration result?**

0 comments on commit cc28d93

Please sign in to comment.