Skip to content

Commit

Permalink
chore: simplify logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaxwood committed Dec 10, 2023
1 parent be10992 commit d3a8bc2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/day10.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ def initialize(map)

def find_farthest_point
position = @map.key('S')
mutate_start(position)
queue = []
queue.push(find_next_move(position))
visited = Set.new(position)
mutate_start(position)
queue = [find_next_move(position)]

# visit every node in the loop
while queue.any?
Expand Down

0 comments on commit d3a8bc2

Please sign in to comment.