Skip to content

Commit

Permalink
Update 0034.在排序数组中查找元素的第一个和最后一个位置.md
Browse files Browse the repository at this point in the history
  • Loading branch information
zou-weidong authored May 28, 2023
1 parent 60a2d4b commit 4a6e87f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand Down

0 comments on commit 4a6e87f

Please sign in to comment.