American Express interview question

How to invert a list.