Python3 Solution
\n\n# Definition for singly-linked list.\n# class ListNode:\n#     def __init__(self, val=0, next=None):\n#         self.val = val\n#         self.next = next\n
\n```\n# Definition for singly-linked list.\n# class ListNode:\n#     def __init__(self, val=0, next=None):\n#         self.val = val\n#         self.next = next\nclass Solution:\n    def splitListToParts(self, head: Optional[ListNode], k: int) -> List[Optional[ListNode]]:\n        ans=[]\n        cur=head\n        n=0\n        while cur:\n            n+=1\n            cur=cur.next\n\n        part,left=n//k,n%k\n        cur=head\n        prev=None\n        for i in range(k):\n            ans.append(cur)\n            for _ in range(part):\n                if cur:\n                    prev=cur\n                    cur=cur.next\n\n            if left and cur:\n                prev=cur\n                cur=cur.next\n                left-=1\n\n            if prev:\n                prev.next=None\n\n        return ans                        \n```
['Python', 'Python3']