Given n numbers. Write a program that finds the index of the 1 that occurs at the k-th position among these numbers. Indexing starts at 0.
The first line contains 2 natural numbers n and k, (1≤n≤105,k≤n).
The second line contains n numbers separated by spaces ai(1≤ai≤105).
A single line with the solution of the problem. If the index does not exist, print −1 .
3 1 2 1 1
1
3 2 2 1 1
2
3 3 2 1 1
-1
Login to be able to submit.