Lyft interview question

Tree path question, some graph BFS. Pretty simple stuff.