Skip to content

Commit 1e5ece4

Browse files
authored
Merge pull request doocs#281 from tczhangzhi/patch-1
Fix outdate number error of findRepeatNumber
2 parents d512017 + 0c20749 commit 1e5ece4

File tree

1 file changed

+3
-2
lines changed
  • lcof/面试题03. 数组中重复的数字

1 file changed

+3
-2
lines changed

lcof/面试题03. 数组中重复的数字/README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ class Solution:
3535
if num == nums[num]:
3636
return num
3737
nums[i], nums[num] = nums[num], nums[i]
38-
38+
num = nums[i]
39+
return -1
3940
```
4041

4142
### **Java**
@@ -96,4 +97,4 @@ func findRepeatNumber(nums []int) int {
9697
```
9798
9899
```
99-
<!-- tabs:end -->
100+
<!-- tabs:end -->

0 commit comments

Comments
 (0)