First Duplicate Value Leetcode Solutions Python