[2024][ruby][6.x] optimize obstacles

main
Alpha Chen 6 days ago
parent a7822ce4f1
commit d45a1cd455
Signed by: alpha
SSH Key Fingerprint: SHA256:3fOT8fiYQG/aK9ntivV3Bqtg8AYQ7q4nV6ZgihOA20g

@ -44,10 +44,11 @@ rescue Loop
true true
end end
pp patrol(input).map(&:first).to_set.length path = patrol(input).map(&:first).to_set
pp path.length
pp input pp input
.select { _2 == ?. } .select { path.include?(_1) && _2 != ?^ }
.select {|xy, _| .select {|xy, _|
# pp xy # pp xy
input[xy] = ?# input[xy] = ?#

Loading…
Cancel
Save