Solution Without using modulus and remainder | 🤯
\n\n Add your space complexity here, e.g. O(n) \n\n# Code\ncpp []\n/**\n * Definition for singly-linked list.\n * struct ListNode {\n *     int val;\n *     Lis
\n\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\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\n   void makeLL(ListNode* &head, int num, vector<ListNode*> &ans) {\n    \n    if (!head) {\n        ans.push_back(nullptr);\n        return;\n    }\n\n    \n    ListNode* current = head;\n    ListNode* prev = nullptr;\n\n\n    for (int i = 0; i < num; i++) {\n        prev = current;\n        current = current->next;\n    }\n\n    \n    if (prev) {\n        prev->next = nullptr;  \n    }\n\n    \n    ans.push_back(head);\n    head = current;\n}\n\n\n\n    vector<ListNode*> splitListToParts(ListNode* head, int k) {\n        int total_nodes = 0;\n\n        ListNode* temp = head;\n        while(temp){\n            total_nodes++;\n            temp = temp->next;\n        }\n\n        vector<ListNode*> ans;\n        while(k){\n            double num = ceil((double)total_nodes/k);\n            k--;\n            total_nodes -= num;\n            makeLL(head, (int)num , ans);\n        }\n\n        return ans;\n    }\n};\n```
['Linked List', 'C++']