Given a queue represented as an array (index 0 is the front) and an integer k, reverse the order of the first k elements while keeping the remaining elements in their original order, and return the resulting queue. The input is JSON {queue, k}.
Input: JSON {queue, k}.
Output: Array — the queue after reversing the first k elements.
Input: {"queue":[1,2,3,4,5],"k":3}
Output: [3,2,1,4,5]
Explanation: First three reversed.Input: {"queue":[1,2,3],"k":3}
Output: [3,2,1]
Explanation: Whole queue reversed.Input: {"queue":[1,2,3,4],"k":0}
Output: [1,2,3,4]
Explanation: Nothing changes.0<=k<=n<=10^5