Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Day13: Add another solution #836

Merged
merged 3 commits into from
Jan 2, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix errornous edit
  • Loading branch information
rolandtritsch authored Dec 31, 2024
commit 84c62d2d7722dd0dfda67e800c3a0f8530798a8a
1 change: 0 additions & 1 deletion docs/2024/puzzles/day13.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ extension (a: Long)
infix def safeDiv(b: Long): Option[Long] =
Option.when(b != 0 && a % b == 0)(a / b)
```
I've completed "Claw Contraption" - Day 13 - Advent of Code 2024 #AdventOfCode
we check that denominator is not zero and that numerator is divisible by denominator.

With the help of `safeDiv`, the solution can be cleanly expressed as:
Expand Down