Concept Flow - Count Occurrences of Element in Sorted Array
Start
Find first occurrence of target
If not found -> return 0
Find last occurrence of target
Calculate count = last - first + 1
Return count
End
We first find where the target starts and ends in the sorted array, then count how many times it appears.
