Tell me about a time you adapted your coding approach because the problem was not like typical LeetCode exercises.
For the hands-on portion, implement a one-pass duplicate detector that works with an iterable rather than assuming a reusable, indexable array. Return the first value whose second occurrence is encountered, or None if every value is unique.
Function: def first_duplicate(values):
values is an iterable of hashable valuesNone when no value repeatsdef first_duplicate(values):