MCPcopy Create free account
hub / github.com/Ainevsia/Leetcode-Rust / dfs

Method dfs

Weekly Contest 179/p3/Solution.cpp:17–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15 vector<int> info_time;
16public:
17 int dfs(int id) {
18 if (subo[id].size() == 0) return 0;
19 int res = 0;
20 for (int sub: subo[id])
21 res = max(res, dfs(sub) + info_time[id]);
22 return res;
23 }
24
25 int numOfMinutes(int n, int headID, vector<int>& manager, vector<int>& informTime) {
26 subo.resize(n, vector<int>());

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected