Element Occurrence
Let's try to count elements. This lesson is of medium-level difficulty.
We'll cover the following...
Problem statement
Suppose we are given a sorted array of integers, find the number of occurrences of a given target value. If the target is not found in the array, return -1
.
Constraints:
- contains values sorted in an ascending order.