This will do
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user