BambooHR interview question

Solve this problem using Python 3.