Java solution with comments beats 100%
\nclass Solution {\n    public ListNode[] splitListToParts(ListNode root, int k) {\n        // prepare the results for each of the buckets upto k size\n\t\tList
```\nclass Solution {\n    public ListNode[] splitListToParts(ListNode root, int k) {\n        // prepare the results for each of the buckets upto k size\n\t\tListNode[] result = new ListNode[k];\n        \n\t\t// if root is null then return the empty array\n        if (root == null)\n            return result;\n        \n        // find the total length of the list\n        int length = 0;\n        ListNode curr = root;\n        while (curr != null){\n            length++;\n            curr = curr.next;\n        }\n        \n        //find the length of each bucket in k buckets \n\t\tint eachLength = length / k;\n        //not every time we get equal size for all the buckets so sometimes some of the bucket will have extra elements in it\n\t\t//so we have to find the length of extra buckets by mod operation\n       \tint extraLength = length % k;\n        \n\t\tint index = 0;\n        curr = root;\n        //loop for all the elements in the list\n        while (curr != null){\n            //for every bucket we start with the current element\n\t\t\tListNode head = curr;\n            \n            //each part difference is either 0 or 1, we use the reminder to identify the difference\n            int difference = extraLength <= 0 ? 0 : 1;\n            \n            //move the pointer to the size of eachlength\n            for(int i=0;i< eachLength + difference - 1;i++)\n                curr = curr.next;\n            \n            //set the next to null\n            ListNode temp = curr.next;\n            curr.next = null;\n            curr = temp;\n            \n            //add to the result array\n            result[index++] = head;\n            \n            //decrement the extra length\n            extraLength--;\n        }       \n        return result;\n    }\n}\n```
['Java']