You are given a singly linked list. Sort it from the smallest value to the largest and return the sorted list.
How the judge passes the data
Examples
Example 1:
Input: head = [9,4,7,1]
Output: [1,4,7,9]
Explanation: The values in increasing order are 1, 4, 7, 9.
Example 2:
Input: head = [3,-2,3,0]
Output: [-2,0,3,3]
Explanation: Equal values (the two 3s) stay next to each other.
Example 3:
Input: head = []
Output: []
Explanation: An empty list is already sorted.