American Express Interview Question

How to invert a list.