Medtronic Interview Question

coding in all possible ways