Skip to content

Commit

Permalink
Remove debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
bewuethr committed Dec 15, 2023
1 parent 48f8237 commit 804529d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions 2023/day12/day12a
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env -S ruby -W0
#!/usr/bin/env ruby

def to_list(record)
record.scan(/#+/).map(&:length).join(",")
Expand All @@ -9,10 +9,7 @@ def generate(record)
locs << idx if c == "?"
end

warn "Question mark locations: #{locs}"

len = locs.length
warn "Generating #{2**len} patterns"
(0...2**len).to_a.map do |n|
arrangement = n.to_s(2).rjust(len, "0").tr("01", ".#")
new_record = record.clone
Expand All @@ -30,9 +27,7 @@ entries = file.readlines.map do |line|
end

sum_counts = entries.sum do |entry|
warn "Original: #{entry[:record]}"
generate(entry[:record]).count do |record|
warn "#{record} vs. #{entry[:list]}"
to_list(record) == entry[:list]
end
end
Expand Down

0 comments on commit 804529d

Please sign in to comment.