3 line python code is enough for this problem


def kthsmallest(self, A, B):
return x[B-1]


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.


@ntnbora2808 did you even read the question ?


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