Given the head of a singly linked list and an integer k, rotate the list to the right by k places.
The last k nodes move to the front. If k >= n, use k = k % n. Return the new head.
Input: Head of a singly linked list and integer k (k >= 0).
Output: Head of the rotated linked list.
Input: [1,2,3,4,5], 2
Output: [4,5,1,2,3]
Explanation: Rotate right 2: [4,5] move to front -> [4,5,1,2,3].Input: [0,1,2], 4
Output: [2,0,1]
Explanation: k=4, n=3. Effective k=1. [2] moves to front.Input: [1,2,3,4,5], 0
Output: [1,2,3,4,5]
Explanation: k=0. No rotation.0<=nodes<=500-100<=Node.val<=1000<=k<=2*10^9