Amazon Interview Question

How to sort these items.