Leetcode 61: Rotate List Java solution
2 min readDec 9, 2021
In this problem we are trying to “rotate” a list the following way:
Given the
head
of a linked list, rotate the list to the right byk
places.
Here are some examples:
At first, it might look a lot like rotating an array, which we have done in this article, but we can also notice that the rotating operation in a list is much different. Indeed, in…