Redundant Connection - Medium Python Graphs Interview Problem | Unnested