Concept Flow - Count Occurrences of Element in Sorted Array
Start
Input: Sorted Array, Target Element
Find First Occurrence Index
Find Last Occurrence Index
Calculate Count = Last - First + 1
Return Count
End
We find where the target first appears, then where it last appears, then count how many times it occurs.