You have been given a sorted array/list of integers 'arr' of size 'n' and an integer 'x'.
Find the total number of occurrences of 'x' in the array/list.
Example:
Input: 'n' = 7, 'x' = 3
'arr' = [1, 1, 1, 2, 2, 3, 3]
Output: 2
Explanation: Total occurrences of '3' in the array 'arr' is 2.
Input Format
The first line of the input contains two integers, n, and x. They represent the size of the array/list and x, respectively.
The second line contains n single space-separated integer representing the array/list elements.
Output Format
Return the total number of occurrences of x in the array/list.
Note:
You are not required to print the expected output, it has already been taken care of. Just implement the function.