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.

Set collection has method add() which return true, if element is inserted successfully else false.

--

--

Prem Parmar
Competitive Programming Problems

Software Engineer, having 3 years of experience in Ecommerce / HCM domain Product based company.