We iterate from a manual counts dict through `Counter` to a one-pass dict-as-ordered-set, then land on Counter filtered by a generator. Readable over clever when the complexity is the same.
We iterate from a manual counts dict through `Counter` to a one-pass dict-as-ordered-set, then land on Counter filtered by a generator. Readable over clever when the complexity is the same.
You are given an integer array nums.
Return an integer denoting the first even integer (earliest by array index) that appears exactly once in nums. If no such integer exists, return -1.
An integer x is considered even if it is divisible by 2.