Pergunta de entrevista da empresa SentinelOne

Standard Coding Question based on Graphs, Trees and their optimizaitons