30:00
Given the head of a linked list, rotate the list to the right by k places.
The number of nodes is in the range [0,500][0, 500][0,500].
−100≤Node.val≤100-100 \leq \text{Node.val} \leq 100−100≤Node.val≤100
0≤k≤2×1090 \leq k \leq 2 \times 10^90≤k≤2×109
Rotate list by 2 positions to the right
1
→
2
3
4
5
null
Phase: counting