Skip to content

Commit 336e727

Browse files
committed
Add day 19 code.
1 parent 3cd3bbd commit 336e727

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

2024/src/day19.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ def parse(input: String): (List[Towel], List[Pattern]) =
2424

2525
def part1(input: String): Int =
2626
val (towels, patterns) = parse(input)
27-
val possiblePatterns = patterns.filter(isPossible(towels))
28-
possiblePatterns.size
27+
patterns.count(isPossible(towels))
2928

3029
def isPossible(towels: List[Towel])(pattern: Pattern): Boolean =
3130
val regex = towels.mkString("^(", "|", ")*$").r

0 commit comments

Comments
 (0)