Javascript Solution


  • 0
    L
    var containsDuplicate = function(nums) {
    var hash = {};
    for(var i in nums)
    {
        if(hash[nums[i]])
        {
            return true;
        }else{
            hash[nums[i]] = true;
        }
    }
    return false;};

Log in to reply
 

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