Count frequency of a number in a sorted array
Given a sorted array of numbers and a number x, count the number of occurrences of x in the array. Input: int arr[] = {1, 3, 3, 4, 4 ,5, 5, 5, 7, 8, 8}; int x = 5; Output: 3
Given a sorted array of numbers and a number x, count the number of occurrences of x in the array. Input: int arr[] = {1, 3, 3, 4, 4 ,5, 5, 5, 7, 8, 8}; int x = 5; Output: 3