Skip to content
We areTOP 1%

Rotate List

MediumLeetCodeLinked List
Solve on LeetCode(opens in a new tab)
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews
Approach hintTry it first, then reveal

Measure the length and reduce k modulo it. Joining the tail to the head forms a ring, and breaking the ring at the right node gives the rotated list.

More in Linked List

Linked List questions
#ProblemPlatformDifficultyOpen1st1st Visit2nd2nd VisitRevRevise
1Middle of the Linked ListLeetCodeEasy Solve Middle of the Linked List on LeetCode (opens in a new tab)
2Reverse Linked ListLeetCodeEasy Solve Reverse Linked List on LeetCode (opens in a new tab)
3Merge Two Sorted ListsLeetCodeEasy Solve Merge Two Sorted Lists on LeetCode (opens in a new tab)
4Remove Linked List ElementsLeetCodeEasy Solve Remove Linked List Elements on LeetCode (opens in a new tab)
5Linked List CycleLeetCodeEasy Solve Linked List Cycle on LeetCode (opens in a new tab)
6Intersection of Two Linked ListsLeetCodeEasy Solve Intersection of Two Linked Lists on LeetCode (opens in a new tab)
7Palindrome Linked ListLeetCodeEasy Solve Palindrome Linked List on LeetCode (opens in a new tab)
8Remove Nth Node From End of ListLeetCodeMedium Solve Remove Nth Node From End of List on LeetCode (opens in a new tab)
9Odd Even Linked ListLeetCodeMedium Solve Odd Even Linked List on LeetCode (opens in a new tab)
10Swap Nodes in PairsLeetCodeMedium Solve Swap Nodes in Pairs on LeetCode (opens in a new tab)
11Rotate ListLeetCodeMedium Solve Rotate List on LeetCode (opens in a new tab)
12Linked List Cycle IILeetCodeMedium Solve Linked List Cycle II on LeetCode (opens in a new tab)
13Reorder ListLeetCodeMedium Solve Reorder List on LeetCode (opens in a new tab)
14Copy List with Random PointerLeetCodeMedium Solve Copy List with Random Pointer on LeetCode (opens in a new tab)

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account