The Cigna Group interview question

Coding question related to Python