Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit deea6b0

Browse files
Merge pull request youngyangyang04#2519 from awsome-knowledge/master
fix: 纠正 target 的拼写
2 parents 0cdf537 + 41bc5e4 commit deea6b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎problems/0034.在排序数组中查找元素的第一个和最后一个位置.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ class Solution {
233233
if (index == -1) { // nums 中不存在 target,直接返回 {-1, -1}
234234
return new int[] {-1, -1}; // 匿名数组
235235
}
236-
// nums 中存在 targe,则左右滑动指针,来找到符合题意的区间
236+
// nums 中存在 target,则左右滑动指针,来找到符合题意的区间
237237
int left = index;
238238
int right = index;
239239
// 向左滑动,找左边界
@@ -450,7 +450,7 @@ class Solution:
450450
return -1
451451
index = binarySearch(nums, target)
452452
if index == -1:return [-1, -1] # nums 中不存在 target,直接返回 {-1, -1}
453-
# nums 中存在 targe,则左右滑动指针,来找到符合题意的区间
453+
# nums 中存在 target,则左右滑动指针,来找到符合题意的区间
454454
left, right = index, index
455455
# 向左滑动,找左边界
456456
while left -1 >=0 and nums[left - 1] == target: left -=1

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /