Search
Given a sorted array, write a function to count the number of occurrences of a target element using binary search. The function should return the number of times the target appears in the array.
n
low = 0
high = 6
mid = 3
high = 2
mid = 1
low = 4
mid = 5