Given the head of a singly linked list and an integer k, split the list into k consecutive parts. The lengths of the parts should be as equal as possible: no two parts may differ in size by more than one, which may leave some parts empty (null). Parts appear in input order, and earlier parts are always at least as long as later ones. Return an array of the k parts.
Given the head of a singly linked list and an integer k, split the list into k consecutive parts. The lengths of the parts should be as equal as possible: no two parts may differ in size by more than one, which may leave some parts empty (null). Parts appear in input order, and earlier parts are always at least as long as later ones. Return an array of the k parts.
Example 1:
Input: {"head":[1,2,3],"k":5}
Output: [[1],[2],[3],[],[]]
Constraints:
The number of nodes in the list is in the range [0,1000].