zh/algorithm/leetcode/array/34_find_first_and_last_position_of_element_in_sorted_array #1
Replies: 1 comment
|
测试评论 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
zh/algorithm/leetcode/array/34_find_first_and_last_position_of_element_in_sorted_array
一、题目描述 给你一个按照非递减顺序排列的整数数组 nums,和一个目标值 target。请你找出给定目标值在数组中的开始位置和结束位置。 如果数组中不存在目标值 target,返回 [-1, -1]。 你必须设计并实现时间复杂度为 O(log n) 的算法解决此问题。 示例 1: 输入: nums = [5,7,7,8,8,10], target = 8 输出: [3,4] 示例 2: 输入: nums = [5,7,7,8,8,10], target = 6 输出: [-1,-1]
https://thecodedmike.github.io/zh/algorithm/leetcode/array/34_find_first_and_last_position_of_element_in_sorted_array.html
All reactions