Insertion Sort List Solutions in PythonNumber 147Difficulty MediumAcceptance 41.2%Link LeetCodeOther languages C++, GoSolutionsPython solution by haoel/leetcodedef insertionSortList(self, head): if not head: return head dummy = ListNode(0) curr = head prev = dummy while curr: next = curr.next while prev.next and prev.next.val < curr.val: prev = prev.next curr.next = prev.next prev.next = curr prev = dummy curr = next return dummy.nextdef insertionSortList(self, head): if not head: return head dummy = ListNode(0) curr = head prev = dummy while curr: next = curr.next while prev.next and prev.next.val < curr.val: prev = prev.next curr.next = prev.next prev.next = curr prev = dummy curr = next return dummy.next