Blink Health Interview Question

Another algo