Skip to content

Commit ce09352

Browse files
committed
Fix outdate number error of findRepeatNumber(#281)
1 parent 1e5ece4 commit ce09352

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lcof/面试题03. 数组中重复的数字/Solution.py

+2
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ def findRepeatNumber(self, nums: List[int]) -> int:
55
if num == nums[num]:
66
return num
77
nums[i], nums[num] = nums[num], nums[i]
8+
num = nums[i]
9+
return -1

0 commit comments

Comments
 (0)