Medtronic Interview Question

Python coding problem to implement a a function that solves the proposed problem