American Express Interview Question

a simple sorting algorithm