Nordstrom Interview Question

Fairly simple string sorting problem