Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 434 Bytes

README.md

File metadata and controls

18 lines (12 loc) · 434 Bytes

126.Search for a Range

Description

Given an array of integers sorted in ascending order, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in the order of O(log n). If the target is not found in the array, return [-1, -1].

Example

Input: [5, 7, 7, 8, 8, 10], 8
Output: [3, 4]

From

LeetCode