leetcode_medium_array

problem

​287. Find the Duplicate Number​

solution #1: 二分法;

code

 

solution #2: 快慢指针;

code:

 

solution #3: 位操作;

code:

 

参考

1. ​​leetcode_287. Find the Duplicate Number​​;

2. ​​Grandyang​​;