BambooHR Interview Question

Solve this problem using Python 3.