Write a function which counts the number of times key appears in the array.
countSearch(int arr[], int size, int key)
Advanced (Bonus Points): Have the function create a dynamic list that would contain the counts if each element was considered as a key for countSearch.