Crowe LLP interview question

Critique a python function