Contains Duplicate Leetcode Python