← Questions
Sort names by text prefix, then numeric suffix
0
I was asked this
No reports yet. Sign in to say where you were asked it.
You get a list of topic names, each a lowercase word, an underscore and a number, such as logs_10 or logs_2. Sort them by the word first and, for the same word, by the number as an integer, so logs_2 comes before logs_10. Keep duplicates. Explain why a plain string sort gets this wrong and what key you sort by.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
