Aurity interview question

Code challenge