Elegant Python with Explanation
This question can be split into three parts:\n\n1. Count the length of the linked list\n2. Determine the length of nodes in each chunk\n3. Splitting the linked 
This question can be split into three parts:\n\n1. Count the length of the linked list\n2. Determine the length of nodes in each chunk\n3. Splitting the linked list up\n\nAt the end of step 2, `res` will look something like this, for a list of length 10 and k of 3: `[4, 4, 3]`.\n\nStep 3 iterates through `res` using the values in `res` and replaces the value at each index with each chunk\'s head node. We have to keep a reference to `prev` in order to slice up the chunks nicely by setting `prev.next = None`.\n\n**\uD83D\uDCAF Check out https://techinterviewhandbook.org for more tips and tricks to ace your technical interview \uD83D\uDCAF**\n\n```\nclass Solution(object):\n    def splitListToParts(self, root, k):\n        # Count the length of the linked list\n        curr, length = root, 0\n        while curr:\n            curr, length = curr.next, length + 1\n        # Determine the length of each chunk\n        chunk_size, longer_chunks = length // k, length % k\n        res = [chunk_size + 1] * longer_chunks + [chunk_size] * (k - longer_chunks)\n        # Split up the list\n        prev, curr = None, root\n        for index, num in enumerate(res):\n            if prev:\n                prev.next = None\n            res[index] = curr\n            for i in range(num):\n                prev, curr = curr, curr.next\n        return res\n```
[]