Exercises/#29 Sort List
#29

Sort List

MediumπŸ”— Linked Lists
90 XP

Problem

Given the head of a linked list, sort it in ascending order using O(n log n) time and O(1) memory.

Examples

Input: 4β†’2β†’1β†’3
Output: 1β†’2β†’3β†’4

Input: -1β†’5β†’3β†’4β†’0
Output: -1β†’0β†’3β†’4β†’5
linked-listmerge-sortdivide-conquer
AI Assistantβ€” powered by AI

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

29 / 150

Your Solution

⚑ JavaScript

to save progress and use AI features