Skip to content
C

Count Occurrences in Sorted Array

Easyjavapythonccppjavascript

Given a sorted array and a target value, count how many times the target occurs.

Input Format

The first line contains two integers N and target. The second line contains N space-separated integers in non-decreasing order.

Output Format

Print the number of occurrences of target.

Input (stdin)

Output

Run your code to see output here...