python one line solution


  • 0
    F

    one line solution for python

    class Solution(object):
    
        def containsDuplicate(self, nums):
            """
            :type nums: List[int]
            :rtype: bool
            """
            return False if len(nums) == len(set(nums)) else True
    

Log in to reply
 

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