Pergunta de entrevista da empresa Uber

Something similar to the leetcode question, Minimum Cost Path with Teleportations