Skip to main content
๐Ÿ“œ WAYPOINT LESSON

Checkpoint: sort by key

โญ beginnerโณ 25 min read๐Ÿ“ Lesson 44 of 256

Stable insertion sort on a computed key (last digit).

Sorting by a computed key with stability preserved is the exam's trickiest sort variant: compare (x % 10), shift only on strict inequality, and the original order of ties survives automatically.