Freenome Interview Question

Application of breadth first search