Find the Kth max and kth min element in array.
Asked in the Technical round stage. Given an integer array nums and positive integer k, return [kth_max, kth_min]. Count duplicate values as separate elements.
nums is a non-empty list of integers, and k satisfies 1 <= k <= len(nums). Return the kth largest value first, followed by the kth smallest value.
def kth_max_min(nums, k):