Pregunta de entrevista de SentinelOne

Standard Coding Question based on Graphs, Trees and their optimizaitons