LearnPy Hub
← Arena
IntermediateRating 1100

Where Would It Go?

The list is sorted with distinct numbers. Print the position (from 0) of x if it's there, otherwise where it would be inserted to keep the list sorted.

Input

n and x, then n integers.

Output

One integer.

Sample 1

Input
4 5
1 3 5 6
Output
2

Sample 2

Input
4 2
1 3 5 6
Output
1
solution.py
Output appears here
Where Would It Go? · Python Arena problem · LearnPy Hub