Swift Solution 118ms using Set


  • 0
    C
    class Solution {
        func containsDuplicate(nums: [Int]) -> Bool {
            return nums.count > Set(nums).count   
        }
    }

Log in to reply
 

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