First Duplicate Value Leetcode Problems Java