3 line python code is enough for this problem


#1

def kthsmallest(self, A, B):
x=list(A)
x.sort()
return x[B-1]


#2

Sorting the entire array ie O(n logn) is excessive for finding just the kth smallest element. There is a O(n) solution using the concept of quick sort. Just search on Youtube.


#3

@ntnbora2808 did you even read the question ?


#4

very funny. you could do that in any language, and it would still be wrong.