Agoda Interview Question

Reverse a list, create certain data structure