Leetcode 61: Rotate List Java solution

Pierre-Marie Poitevin
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 by k places.

Here are some examples:

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…

--

--