Prima Assicurazioni interview question

Implement a python decorator to cache recursive function results.