aboutsummaryrefslogtreecommitdiff
path: root/network_delay_time.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'network_delay_time.cpp')
-rw-r--r--network_delay_time.cpp22
1 files changed, 0 insertions, 22 deletions
diff --git a/network_delay_time.cpp b/network_delay_time.cpp
deleted file mode 100644
index 7d46995..0000000
--- a/network_delay_time.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "leetcode.h"
-
-class Solution {
-public:
- int networkDelayTime(vector<vector<int>> &times, int n, int k) {
- vector<int> dist(n + 1, INT_MAX);
- dist[k] = 0;
- for (int i = 0; i < n; i++) {
- for (vector<int> e : times) {
- int u = e[0], v = e[1], w = e[2];
- if (dist[u] != INT_MAX && dist[v] > dist[u] + w)
- dist[v] = dist[u] + w;
- }
- }
- int maxWait = 0;
- for (int i = 1; i <= n; i++)
- maxWait = max(maxWait, dist[i]);
- return maxWait == INT_MAX ? -1 : maxWait;
- }
-};
-
-int main() {}