You are given the head of a singly linked list.
Your task is to sort the linked list.
Note that:
Return the head of the now-sorted list.
4 → 2 → 1 → 3 → null
1 → 2 → 3 → 4 → null
The list is sorted from 4 -> 2 -> 1 -> 3 to 1 -> 2 -> 3 -> 4.
-1 → 5 → 3 → 4 → 0 → null
-1 → 0 → 3 → 4 → 5 → null
The list is sorted, including negative numbers.
None
None
An empty list remains empty.
4 → 2 → 1 → 3 → null
1 → 2 → 3 → 4 → null