This will do
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/all-checks-complete Pipeline was successful

This commit is contained in:
Smaug123
2023-12-12 19:16:03 +00:00
parent 7921cb5652
commit 9012728df8

View File

@@ -88,36 +88,39 @@ module Day12 =
if currentGroupIndex >= groups.Count then
LanguagePrimitives.GenericZero
else
let mutable isOk = true
for i = 1 to groups.[currentGroupIndex] - 1 do
if isOk && (i >= line.Length || (line.[i] <> '#' && line.[i] <> '?')) then
isOk <- false
let mutable isOk = true
if not isOk then
for i = 1 to groups.[currentGroupIndex] - 1 do
if isOk && (i >= line.Length || (line.[i] <> '#' && line.[i] <> '?')) then
isOk <- false
if not isOk then
LanguagePrimitives.GenericZero
else if groups.[currentGroupIndex] < line.Length then
if
groups.[currentGroupIndex] < line.Length
&& line.[groups.[currentGroupIndex]] = '#'
then
LanguagePrimitives.GenericZero
else if groups.[currentGroupIndex] < line.Length then
if
groups.[currentGroupIndex] < line.Length
&& line.[groups.[currentGroupIndex]] = '#'
then
LanguagePrimitives.GenericZero
else
solve
dict
(line.Slice (groups.[currentGroupIndex] + 1))
groups
(remainingToFill - groups.[currentGroupIndex] - 1)
(currentGroupIndex + 1)
else
solve
dict
ReadOnlySpan<_>.Empty
(line.Slice (groups.[currentGroupIndex] + 1))
groups
(remainingToFill - groups.[currentGroupIndex] - 1)
(currentGroupIndex + 1)
else
solve
dict
ReadOnlySpan<_>.Empty
groups
(remainingToFill - groups.[currentGroupIndex] - 1)
(currentGroupIndex + 1)
ifDot + ifHash
let ans = ifDot + ifHash
dict.TryAdd ((line.Length, currentGroupIndex), ans) |> ignore
ans
| _ ->
if currentGroupIndex = groups.Count then
LanguagePrimitives.GenericOne