Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 313a75b

Browse filesBrowse files
Update 645.py
1 parent 171f327 commit 313a75b
Copy full SHA for 313a75b

File tree

1 file changed

+6
-0
lines changed
Filter options

1 file changed

+6
-0
lines changed

‎501-1000/645.py

Copy file name to clipboard
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
class Solution:
22
def findErrorNums(self, nums: List[int]) -> List[int]:
33
return [sum(nums)-sum(set(nums)), int(len(nums)*(len(nums)+1)/2-sum(set(nums)))]
4+
5+
class Solution:
6+
def findErrorNums(self, nums: List[int]) -> List[int]:
7+
x = (len(nums)*(len(nums)+1))//2
8+
s = sum(set(nums))
9+
return [sum(nums)-s, x-s]
410

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.