Count frequency of target element in sorted array

Count frequency of target element in sorted array - Coding Problem | K5kC