Skip to content

Commit dfb56b1

Browse files
initial thoughts on problem 2045
1 parent d7d7a5b commit dfb56b1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

problems/2045/paxtonfitzpatrick.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# [Problem 2045: Second Minimum Time to Reach Destination](https://leetcode.com/problems/second-minimum-time-to-reach-destination/description/?envType=daily-question)
2+
3+
## Initial thoughts (stream-of-consciousness)
4+
5+
- okay, this one looks tricky. One initial thought I have is that a path that involves revisiting some node will be the second shortest path only if there aren't two paths that *don't* involve revisiting a node. So I think I can ignore that outside of those specific cases.
6+
- It sounds like we'll need to use some algorithm that finds *all* paths between a target and destination node. I know Djikstra's algorithm can be modified to terminate early upon encountering a target node, so maybe there's a way to modify it such that it terminates when it encounters that node a second time?
7+
8+
## Refining the problem, round 2 thoughts
9+
10+
### Other notes
11+
12+
## Attempted solution(s)
13+
14+
```python
15+
class Solution:
16+
def secondMinimum(self, n: int, edges: List[List[int]], time: int, change: int) -> int:
17+
18+
```

0 commit comments

Comments
 (0)