from array import *n=int(input())k=int(input())arr=list(map(int,input().split()))arr.sort()r=arr[k+1]print(r)
6 3 7 10 4 3 20 15
15
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!