def missingNumber(self, nums): """ :type nums: List[int] :rtype: int """ n = len(nums) return (n*(n+1)/2) - sum(nums)
@grodrigues3 >! How does this work for [4,5,6,8] . Wont the answer turn out to be negative?
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.