Problem
Given thehead of a linked list, rotate the list to the right by k places.
Examples
Constraints
- The number of nodes in the list is in the range [0, 500].
- -100 <= Node.val <= 100
- 0 <= k <= 2 * 10^9
Tested Python solution for LeetCode 61 with 17 pytest cases. Generate a practice environment with lcpy.
head of a linked list, rotate the list to the right by k places.