def findErrorNums(self, nums):
n = len(nums)
s = (1+n)*n/2
sn = sum(nums)
a = collections.Counter(nums).most_common(1)
b = s-sn+a
let s = Sum(1...n) = (1+n)*n/2
let sn=sum(nums) which means the current sum for the mismatch list,
then s = sn -a + b which a is the duplicate number and b is the missing number.
Simple math problem
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.