Medtronic Interview Question

dsa question easy - medium level