Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

contains duplicate

public bool ContainsDuplicate(int[] nums) 
{
        var hashSet = new HashSet<int>(nums);
        return hashSet.Count != nums.Length;
}
 
PREVIOUS NEXT
Tagged: #duplicate
ADD COMMENT
Topic
Name
1+6 =