Javascript ES6 One Line Solution (AC, fast)


  • 1
    E
    /**
     * @param {number[]} nums
     * @return {number}
     */
    const containsDuplicate = function(nums) {
        return !(nums.length === (new Set(nums)).size)
    }
    

Log in to reply
 

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