Python[setA-setB],ONE line


  • 0
    S

    Just a set problem, using - operator.

    class Solution:
        def findDisappearedNumbers(self, nums):
            return list(set(range(1, len(nums)+1)) - set(nums))
    

Log in to reply
 

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