You are given a graph with n nodes where each node contains an integer value. First, determine the node having the maximum value. Starting from this node, find a path to every other node in the graph.
For each path obtained:
Remove all repeated node occurrences, keeping only the first occurrence.
Store the resulting path as an array.
Return all such processed paths.
Input Format
n: number of nodes
values[]: array of size n, where values[i] is the value of node i
edges[][]: list of edges where each edge connects two nodes
Output Format
Return a list of arrays, where each array represents a cleaned path from the max-value node to another node.
1 <= n <= 10^5
0 <= edges.length <= 2 * 10^5
Graph contains no self-loops
Node values are integers
Graph is connected