May 262017
 

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

Continue reading »

vliegen123.nl