Pregunta de entrevista de Databricks

Leetcode medium - hard level, some shortest path question