Accepted Solution using JAVA
public class Solution {\n    public ListNode insertionSortList(ListNode head) {\n        ListNode helper=new ListNode(0);\n        ListNode pre=helper;\n       
    public class Solution {\n    public ListNode insertionSortList(ListNode head) {\n        ListNode helper=new ListNode(0);\n        ListNode pre=helper;\n        ListNode current=head;\n        while(current!=null) {\n            pre=helper;\n            while(pre.next!=null&&pre.next.val<current.val) {\n                pre=pre.next;\n            }\n            ListNode next=current.next;\n            current.next=pre.next;\n            pre.next=current;\n            current=next;\n        }\n        return helper.next;\n    }\n}
[]