C++ || easy solution
\n/**\n * Definition for singly-linked list.\n * struct ListNode {\n *     int val;\n *     ListNode *next;\n *     ListNode() : val(0), next(nullptr) {}\n *   
```\n/**\n * Definition for singly-linked list.\n * struct ListNode {\n *     int val;\n *     ListNode *next;\n *     ListNode() : val(0), next(nullptr) {}\n *     ListNode(int x) : val(x), next(nullptr) {}\n *     ListNode(int x, ListNode *next) : val(x), next(next) {}\n * };\n */\nclass Solution {\npublic:\n    vector<ListNode*> splitListToParts(ListNode* root, int k) {\n        //first calculate the length\n        int len=0;\n        ListNode* temp=root;\n        while(temp)\n        {\n            len++;\n            temp=temp->next;\n        }\n        \n        int numNodes=len/k; //the number of nodes that are to be in each group\n        int extra=len%k;  //the extra nodes that are left\n        int i=0;\n        vector<ListNode*> res;\n        temp=root;\n        while(temp)\n        {\n            res.push_back(temp);\n            //get the numNodes and make the last node next to NULL\n            int currLen=1;\n            while(currLen<numNodes)\n            {\n                temp=temp->next;\n                currLen++;\n            }\n            if(extra>0 && len>k)\n            {\n                temp=temp->next;\n                extra--;\n            }\n            ListNode* x=temp->next;\n            temp->next=NULL;\n            temp=x;\n        }\n        //if the number of nodes are less than k we add NULL\n        while(len<k)\n        {\n            res.push_back(NULL);\n            len++;\n        }\n        return res;\n        \n    }\n};\n```\n\n**Please upvote if this helps you :)**
['C']