Given the head of a linked list, rotate the list to the right by k places. k may be larger than the list length. The list is given as an array; return the rotated array. Input: '[list], k'.
Input: '[list], k'.
Output: Array — the rotated list.
Input: [1,2,3,4,5], 2
Output: [4,5,1,2,3]
Explanation: Last two move to the front.Input: [0,1,2], 4
Output: [2,0,1]
Explanation: k mod n = 1.Input: [1,2], 0
Output: [1,2]
Explanation: No rotation.0<=n<=5000<=k<=2*10^9