
There is an undirected graph with n nodes numbered from 0 to n - 1 ( inclusive ). You are given a 0-indexed integer array values where values[i] is the value of the i ^th node. You are also given a 0-indexed 2D integer array edges , where each edges[j] = [u _j , v _j , time _j ] indicates that there is an undirected edge between the nodes u _j and v _j , _ and it takes time _j seconds to travel between the two nodes. Finally, you are given an integer maxTime .
A valid path in the graph is any path that starts at node 0 , ends at node 0 , and takes at most maxTime seconds to complete. You may visit the same node multiple times. The quality of a valid path is the sum of the values of the unique nodes visited in the path (each node's value is added at most once to the sum).
Return the maximum quality of a valid path .
Note: There are at most four edges connected to each node.
n == values.length1 <= n <= 10000 <= values[i] <= 10 ^80 <= edges.length <= 2000edges[j].length == 30 <= u _j < v _j <= n - 110 <= time _j , maxTime <= 100All the pairs [u _j , v _j ] are unique .There are at most four edges connected to each node.The graph may not be connected.