Medtronic interview question

coding in all possible ways