We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d945cb8 commit 2434b3bCopy full SHA for 2434b3b
2024/19/index.html
@@ -319,11 +319,9 @@ <h2 id="problem-name">Linen Layout</h2>
319
cache.GetOrAdd(pattern, (pattern) =>
320
pattern switch {
321
"" => 1,
322
- _ => (
323
- from towel in towels
324
- where pattern.StartsWith(towel)
325
- select MatchCount(towels, pattern[towel.Length..], cache)
326
- ).Sum()
+ _ => towels
+ .Where(pattern.StartsWith)
+ .Sum(towel => MatchCount(towels, pattern[towel.Length ..], cache))
327
}
328
);
329
}</code></pre></div>
0 commit comments