Search⌘ K
AI Features

Split Linked List in Parts

Split Linked List in Parts divides a linked list into k consecutive parts with sizes differing by at most one, giving earlier parts more nodes and returning them in an array, with empty parts as NULL.

Statement

You are given head of a singly linked list and an integer, k. Your task is to ...