← 返回 meta 的题目列表Find Target Number Frequency in Sorted Array
类型:online_judge
Given a sorted array and a target number, use the binary search algorithm to calculate the frequency of the target number within the array. Provide the method to use binary search to find the leftmost and rightmost index of the target number.
Example
Input
[1, 2, 2, 2, 3, 4, 5]
2