mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-06 23:28:29 +08:00
Merge pull request #2519 from awsome-knowledge/master
fix: 纠正 target 的拼写
This commit is contained in:
@ -233,7 +233,7 @@ class Solution {
|
||||
if (index == -1) { // nums 中不存在 target,直接返回 {-1, -1}
|
||||
return new int[] {-1, -1}; // 匿名数组
|
||||
}
|
||||
// nums 中存在 targe,则左右滑动指针,来找到符合题意的区间
|
||||
// nums 中存在 target,则左右滑动指针,来找到符合题意的区间
|
||||
int left = index;
|
||||
int right = index;
|
||||
// 向左滑动,找左边界
|
||||
@ -450,7 +450,7 @@ class Solution:
|
||||
return -1
|
||||
index = binarySearch(nums, target)
|
||||
if index == -1:return [-1, -1] # nums 中不存在 target,直接返回 {-1, -1}
|
||||
# nums 中存在 targe,则左右滑动指针,来找到符合题意的区间
|
||||
# nums 中存在 target,则左右滑动指针,来找到符合题意的区间
|
||||
left, right = index, index
|
||||
# 向左滑动,找左边界
|
||||
while left -1 >=0 and nums[left - 1] == target: left -=1
|
||||
|
Reference in New Issue
Block a user