Given the head of a singly linked list that is sorted in nondecreasing order based on the absolute values of its nodes, sort the linked list in nondecreasing order by the actual values of its nodes and return the sorted list.
Constraints:
The number of nodes in the list is in the range
Node.val
head is sorted in nondecreasing order using the absolute value of its nodes.
Given the head of a singly linked list that is sorted in nondecreasing order based on the absolute values of its nodes, sort the linked list in nondecreasing order by the actual values of its nodes and return the sorted list.
Constraints:
The number of nodes in the list is in the range
Node.val
head is sorted in nondecreasing order using the absolute value of its nodes.