Freenome Interview Question

LC hard question