摘要:
https://leetcode.com/problems/single-number-iii/Given an array of numbersnums, in which exactly two elements appear only once and all the other elemen... 阅读全文
摘要:
https://leetcode.com/problems/single-number-ii/Given an array of integers, every element appears three times except for one. Find that single one.在网上看... 阅读全文
摘要:
依然二分,转向条件,容易出问题的地方。对于<=情况,截止区间是0;使用mid-1需要多进行一次查找通过left=mid+1修正区间;对于<情况,截止区间是1;使用right=mid可以直接得到正确区间。https://leetcode.com/problems/first-bad-version//... 阅读全文