LearnPy Hub
← Arena
IntermediateRating 1100

First Position

The array is sorted. Print the first index where x appears, or -1. Use binary search (bisect).

Input

n x, then n sorted integers.

Output

An index.

Sample 1

Input
6 4
1 2 4 4 4 7
Output
2

Sample 2

Input
3 5
1 2 3
Output
-1
solution.py
Output appears here
First Position · Python Arena problem · LearnPy Hub