|
|
@ -14,11 +14,11 @@ loop do
|
|
|
|
cave.fetch(path.last)
|
|
|
|
cave.fetch(path.last)
|
|
|
|
# .reject { _1 =~ /^[a-z]+$/ && path.include?(_1) }
|
|
|
|
# .reject { _1 =~ /^[a-z]+$/ && path.include?(_1) }
|
|
|
|
.reject { _1 == "start" }
|
|
|
|
.reject { _1 == "start" }
|
|
|
|
.map { path + [_1] }
|
|
|
|
.reject {|cave|
|
|
|
|
.reject {|path|
|
|
|
|
smalls = path.tally.select { _1 =~ /^[a-z]+$/ }
|
|
|
|
small = path.tally.select { _1 =~ /^[a-z]+$/ }
|
|
|
|
smalls.fetch(cave, 0) > (smalls.any? { _2 > 1 } ? 0 : 1)
|
|
|
|
(small.count { _2 > 1 } > 1) || small.any? { _2 > 2 }
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.map { path + [_1] }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|