Dijkstra
rust []\nuse std::collections::BinaryHeap;\nuse std::cmp::Reverse;\n\nimpl Solution {\n    pub fn min_time_to_reach(move_time: Vec<Vec<i32>>) -> i32 {\n        
```rust []\nuse std::collections::BinaryHeap;\nuse std::cmp::Reverse;\n\nimpl Solution {\n    pub fn min_time_to_reach(move_time: Vec<Vec<i32>>) -> i32 {\n        let n = move_time.len();\n        let m = move_time[0].len();\n        let mut q = BinaryHeap::new();\n        let mut seen = vec![vec![false; m]; n];\n        q.push((Reverse(0),1,0,0));\n        seen[0][0] = true;\n        while let Some((Reverse(t), x, i, j)) = q.pop() {\n            if (i,j) == (n-1, m-1) {return t }\n            for (i,j) in [(i+1, j), (i.wrapping_sub(1),j), (i, j+1), (i, j.wrapping_sub(1))] {\n                if i >= n || j >= m  || seen[i][j] {continue}\n                seen[i][j] = true;\n                q.push((Reverse(x+t.max(move_time[i][j])), 3-x, i, j))\n            }\n        }\n        unreachable!()\n    }\n}\n```
['Rust']