Leetcode Unique Element In Python Class