C++ clean
```\n/\n * Definition for singly-linked list.\n * struct ListNode {\n *     int val;\n *     ListNode next;\n *     ListNode(int x) : val(x), next(NULL) {}\n * 
```\n/**\n * Definition for singly-linked list.\n * struct ListNode {\n *     int val;\n *     ListNode *next;\n *     ListNode(int x) : val(x), next(NULL) {}\n * };\n */\nclass Solution {\npublic:\n    vector<ListNode*> splitListToParts(ListNode* root, int k) {\n        vector<ListNode*>ans(k, NULL);\n        int size = 0;\n        ListNode* node = root;\n        while(node)\n        {\n            size++;\n            node = node -> next;\n        }\n        int base = size / k;\n        int extra = size % k;\n        int i = 0;\n        for(; i < extra && root; i++)\n        {\n            ans[i] = root;\n            for(int j = 0; j < base; j++)\n                root = root -> next;\n            node = root;\n            root = root -> next;\n            node -> next = NULL;\n        }\n        \n        for(; i < k && root; i++)\n        {\n            ans[i] = root;\n            for(int j = 1; j < base; j++)\n                root = root -> next;\n            node = root;\n            root = root -> next;\n            node -> next = NULL;\n        }\n        \n        return ans;\n    }\n};
[]