Java 0ms 100% faster | Simple and Easy Solution
TC -> O(N+k)\nSC -> O(max(N,k))\n\nclass Solution {\n    public static ListNode[] splitListToParts(ListNode head, int k) {\n\t\n        int len = length(head); 
**TC -> O(N+k)\nSC -> O(max(N,k))**\n```\nclass Solution {\n    public static ListNode[] splitListToParts(ListNode head, int k) {\n\t\n        int len = length(head); //get the length of the linked list\n\t\t\n        int size = len/k; //to calculate the number of divisions\n\t\t\n        int rem = len%k; //to get the remaining parts, if they were not able to get paired in the division\n\t\t\n        ListNode current = head;\n        ListNode prev = head;\n        int i=0;\n        \n        ListNode [] ans = new ListNode[k]; // Array of type ListNode, to be returned\n        \n        while(current != null && i<k){\n            ans[i]=current;\n            for(int j=0; j<size+(rem>0?1:0);j++){\n                prev = current;\n                current = current.next;\n            }\n            prev.next = null;\n            i++;\n            rem--;\n        }\n        return ans;\n    }\n    \n    public static int length(ListNode head){ // Function to calculate the length of the Linked List\n        ListNode current = head;\n        int len =0;\n        while(current != null){\n            len++;\n            current = current.next;\n        }\n        return len;\n    }\n}\n```\n**Perform a dry run for better understanding !\nHappy Coding !\nDo Upvote if it helped !**
['Java']