Categorygithub.com/szhou12/leetcode-goleetcode3342-Find-Minimum-Time-to-Reach-Last-Room-II
package
0.0.0-20241220224003-b7cf03a90b2b
Repository: https://github.com/szhou12/leetcode-go.git
Documentation: pkg.go.dev

# README

3342. Find Minimum Time to Reach Last Room II

Solution idea

Dijkstra

  • 矩阵走格子类型题。与3341. Find Minimum Time to Reach Last Room I的思路基本一致。
  • 唯一区别: node储存一个额外状态,即,步入下一个格子需要花费的时间:如果当前花费1s,下一个花费2s;如果当前花费2s,下一个花费1s.

Time complexity = $O(mn\log{mn})$