Freenome interview question

LC hard question