Nordstrom interview question

Fairly simple string sorting problem