Merge pull request #2107 from zou-weidong/patch-1
Update 0034.在排序数组中查找元素的第一个和最后一个位置.md
This commit is contained in:
commit
882463bbae
|
|
@ -240,7 +240,7 @@ class Solution {
|
|||
while (left - 1 >= 0 && nums[left - 1] == nums[index]) { // 防止数组越界。逻辑短路,两个条件顺序不能换
|
||||
left--;
|
||||
}
|
||||
// 向左滑动,找右边界
|
||||
// 向右滑动,找右边界
|
||||
while (right + 1 < nums.length && nums[right + 1] == nums[index]) { // 防止数组越界。
|
||||
right++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue