mirror of
https://github.com/CyC2018/CS-Notes.git
synced 2025-07-09 12:23:16 +08:00
auto commit
This commit is contained in:
@ -105,8 +105,8 @@ public class ThreeSumFast {
|
|||||||
while (l <= h) {
|
while (l <= h) {
|
||||||
int m = l + (h - l) / 2;
|
int m = l + (h - l) / 2;
|
||||||
if (target == nums[m]) return m;
|
if (target == nums[m]) return m;
|
||||||
else if (target > nums[m]) h = m - 1;
|
else if (target > nums[m]) l = m + 1;
|
||||||
else l = m + 1;
|
else h = m - 1;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user