Find The Kth Max And Min Element Of An Array In Python