Contains Duplicate Leetcode Solution Using Hashmap