Contains Duplicate
Published in
Jul 4, 2022
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.