Concept Flow - Count Occurrences of Element in Sorted Array
Start
Find first occurrence of target using binary search
Find last occurrence of target using binary search
Calculate count = last_index - first_index + 1
Return count
End
We use two binary searches to find the first and last positions of the target, then count how many times it appears.