Problem Description
1 <= |A| <= 106
1 <= B <= |A|
1 <= A[i] <= 109
The first argument is an integer array A.
The second argument is integer B.
Return the Bth smallest element in given array.
Input 1:
A = [2, 1, 4, 3, 2] B = 3
Input 2:
A = [1, 2] B = 2
Output 1:
2
Output 2:
2
Explanation 1:
3rd element after sorting is 2.
Explanation 2:
2nd element after sorting is 2.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.