Company: Atlassian_26july
Difficulty: medium
You are given a weighted undirected graph with graph_nodes nodes and graph_edges edges. The nodes are numbered from 1 to graph_nodes . The stress level of a path between two nodes is defined as the weight of the heaviest edge on that path. Given a source node source and a destination node destination , find the minimum possible stress level over all paths from source to destination . If no such path exists, return -1 . If source and destination are the same node, the answer is 0 (an empty path has no edges). Input Format The first line contains two space-separated integers graph_nodes and graph_edges . Each of the next graph_edges lines contains three space-separated integers u , v , and w , describing an undirected edge between nodes u and v with weight w . The last line contains two space-separated integers source and destination . Output Format Print a single integer: the minimum possible stress level of a path from source to destination , or -1 if no path exists. Constraints 2 <