Contain Duplicate Leetcode Solution