diff --git a/2024/ruby/day_06.rb b/2024/ruby/day_06.rb index 3e6f3ea..8ef0cf0 100644 --- a/2024/ruby/day_06.rb +++ b/2024/ruby/day_06.rb @@ -44,10 +44,11 @@ rescue Loop true end -pp patrol(input).map(&:first).to_set.length +path = patrol(input).map(&:first).to_set +pp path.length pp input - .select { _2 == ?. } + .select { path.include?(_1) && _2 != ?^ } .select {|xy, _| # pp xy input[xy] = ?#