Python: really short and clean solution
\nbase_block_length - is a shortest length of nested arrays, based on n div k. For example, for a queue of length 7 and k = 3, our minimum length will be 2, bec
\n`base_block_length` - is a shortest length of nested arrays, based on `n div k`. For example, for a queue of length `7` and `k = 3`, our minimum length will be `2`, because `7 div 3 == 2`\n\n`long_block_idx` - is an `index + 1` of last nested array with a length `base_block_length + 1` (In our example it's `3 = 2 + 1`). And it is calculated as `n mod k`. In our previous example it is `1`, because `7 mod 3 == 1`. Since it is an `index + 1`, our last longest block index is `1 - 1 = 0`. *Please note: because of the implementation we operate with `index + 1` instead of `index`*\n\nBack to our example: first nested array has `3` elements and the rest ones have `2`. `k = 3 => [[X X X], [X X], [X X]]`  \n```\nclass Solution(object):\n    def splitListToParts(self, root, k):\n        result = []\n\n        n = 0\n        cur = root\n        while cur:\n            n += 1\n            cur = cur.next\n\n        cur = root\n        base_block_length, long_block_idx = divmod(n, k)\n\n        for block_idx in range(0, k):\n            block = []\n\n            for i in range(0, base_block_length + int(block_idx < long_block_idx)):\n                block.append(cur.val)\n                cur = cur.next\n\n            result.append(block)\n\n        return result\n```
[]