C# solution: hashset


  • 0
    B
    public class Solution 
    {
        public bool ContainsDuplicate(int[] nums) 
        {
            var numSet = new HashSet<int>(nums);
    		return numSet.Count != nums.Length;
        }
    }
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.