Given the head of a linked list, sort it in ascending order using O(n log n) time and O(1) memory.
Input: 4β2β1β3 Output: 1β2β3β4 Input: -1β5β3β4β0 Output: -1β0β3β4β5
Unlock hints progressively β start gentle, go deeper only if needed.
Level 1: Gentle Nudge
A subtle direction
Level 2: Approach
The algorithm to use
Level 3: Detailed
Step-by-step guidance
to save progress and use AI features