问题描述:
Write a function to find the kth element in the given array.

测试用例:
['assert kth_element([12,3,5,7,19], 5, 2) == 3', 'assert kth_element([17,24,8,23], 4, 3) == 8', 'assert kth_element([16,21,25,36,4], 5, 4) == 36']

生成的代码:
def kth_element(arr, n, k):
    arr.sort()
    return arr[k-1]

assert kth_element([12,3,5,7,19], 5, 2) == 3
assert kth_element([17,24,8,23], 4, 3) == 8
assert kth_element([16,21,25,36,4], 5, 4) == 36