leetcode61. Rotate List
Given the head of a linked list, rotate the list to the right by k places. 给你一个链表的头节点 head ,旋转链表,将链表每个节点向右移动 k 个位置。 Input: head [1,2,3,4,5], k 2 Output: [4,5,1,2,3] class Solution: def rotateRight(self, …
2025-11-28