Leetcode Contains Duplicate Ii Java