Split Linked List in parts | C++ | easy to understand
```\nclass Solution {\npublic:\n    vector splitListToParts(ListNode* head, int k) {\n        vector ans;\n        int n=0;\n        auto count = head;\n       
```\nclass Solution {\npublic:\n    vector<ListNode*> splitListToParts(ListNode* head, int k) {\n        vector<ListNode* > ans;\n        int n=0;\n        auto count = head;\n        while(count!=NULL){\n            n++;\n            count=count->next;\n        }\n        auto temp= head;\n        while(k){\n            int a= ceil((double)n/(double)k);\n            ans.push_back(temp);\n            n-=a;\n            k--;\n            while(--a&&temp!=NULL){\n                temp= temp->next;\n            }\n            if(temp!=NULL){\n                head= temp->next;\n                temp->next=NULL;\n                temp= head;\n            }\n        }\n        return ans;\n    }\n};
[]