Search⌘ K
AI Features

Rotate List

Rotate List shifts a singly linked list to the right by a given number of positions, making the last nodes the new head and returning the resulting list.

Statement

You are given the head of a singly linked list and a non-negative integer k. Your task is ...