← Amazon questions

Sort strings by version and ID

Filed under Amazon

Given an array of strings with IDs and versions (alphabetic versions are older, numerical versions are newer), sort them lexicographically by version first, and then by ID if there is a clash, while…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.