First Duplicate Value Leetcode Python