Easy JAVA Solution(Beats 100% runtime)
\n# Approach\n1.Traverse the linked list first to find the length of the linked list.\n2.Find how many nodes should be there in each of k lists by dividing the 
\n# Approach\n1.Traverse the linked list first to find the length of the linked list.\n2.Find how many nodes should be there in each of k lists by dividing the length by k.\n3.Find the modulo of length by k to find how many extra nodes are present.\n5.Create an ans array of ListNode.\n6.Take a prev node and head node and traverse the head pointer x times and assign prev as head in every iteration.\n7.Put head in every iteration ans array.\n8.After completion of moving the pointer x times,check whether the remainder is greater than 0, if yes, that means we have to add one more node to the list and decrease the remainder count.\n9.Continue till the head pointer becomes null and return the ans array.\n\n\n# Code\n```\n/**\n * Definition for singly-linked list.\n * public class ListNode {\n *     int val;\n *     ListNode next;\n *     ListNode() {}\n *     ListNode(int val) { this.val = val; }\n *     ListNode(int val, ListNode next) { this.val = val; this.next = next; }\n * }\n */\nclass Solution {\n    public ListNode[] splitListToParts(ListNode head, int k) {\n        ListNode[] ans=new ListNode[k];\n        ListNode temp=head;\n        int count=0;\n        while(temp!=null){\n            count++;\n            temp=temp.next;\n        }\n\n        int x=count/k;\n        int y=count%k;\n        ListNode prev=null;\n        int i=0;\n        while(head!=null){\n            ans[i++]=head;\n            count=0;\n            while(head!=null&&count<x)\n          { \n            prev=head;\n            head=head.next;\n            count++;\n            }\n            if(y>0){\n                prev=head;\n                if(head!=null)\n                head=head.next;\n                y--;\n            }\n            if(prev!=null)\n            prev.next=null;\n        }\n       \n        return ans;\n    }\n}\n```
['Linked List', 'Java']