Arnab - are you working on Advent of Code Day 1 / ...
# getting-started
t
Arnab - are you working on Advent of Code Day 1 / Problem 2? I solved the "first duplicate" issue by recursing and keeping an accumulation of the spots I've been to as a set. When the function detects that you've moved into a spot the set contains, the path traversal is over. That way I don't have to traverse the entire path if a duplicate occurs quickly.