First Duplicate Value Leetcode Javascript Questions