Neetcode 150 Cpp Sample Solution
Neetcode 150 Cpp Sample Solution
Contains Duplicate
Given an integer array nums, return true if any value appears at least twice in the array, and
return false if every element is distinct.
Optimal (C++):
🧠 Intuition: Use a hash set to keep track of seen elements. If any element is already in the set,
return true.