diff --git a/2024/Day19/Solution.cs b/2024/Day19/Solution.cs index 65d5f0e4..952efada 100644 --- a/2024/Day19/Solution.cs +++ b/2024/Day19/Solution.cs @@ -29,11 +29,9 @@ long MatchCount(string[] towels, string pattern, Cache cache) => cache.GetOrAdd(pattern, (pattern) => pattern switch { "" => 1, - _ => ( - from towel in towels - where pattern.StartsWith(towel) - select MatchCount(towels, pattern[towel.Length..], cache) - ).Sum() + _ => towels + .Where(pattern.StartsWith) + .Sum(towel => MatchCount(towels, pattern[towel.Length ..], cache)) } ); } \ No newline at end of file