Microsoft Interview Question

Algoritmo DBFS, Heapq, test de 1:50h, dificil