Logic Loophole I initially wrote this line at the beginning of the loop if (numbers[j] >= target) j--; Then I find I didn’t consider the 0 case. so changed into > rather than >=
Code Optimization My first-time solution twoSumByTwoPointers1() is not concise. see the twoSumByTwoPointers2() makes some thinking
Decrements of j are the same condition before and after locatingnumbers[j] ~~ target. If not consider time complexity, it can be merged
The i and j won’t miss any possibilities when i < j because i++ and j– are only solutions in respect of two potential conditions sum < targetand sum > target
思路2: BinarySearch + two pointers
* 用binarySearch找到end的初始位置, 然后用two pointers
* For the binary search, the start have to change, to better locate the mid.