Swap Kth from beginning and Kth from end