Set() is useful in this case to unique the list.

```
class Solution(object):
def findErrorNums(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
n = len(nums)
# sum of error list
nums_sum = sum(nums)
# sum of normal list
all_sum = n*(n+1)/2
# sum of unique elements
unique_sum = sum(list(set(nums)))
return [nums_sum-unique_sum, all_sum - unique_sum]
```