Company: Salesforce AMTS role On-campus_1july
Difficulty: medium
A Salesforce organization contains org_nodes number of Salesforce entities (such as Accounts, Opportunities, or Leads), numbered from 1 to org_nodes . There are org_edges relationships between these entities where the i th relationship connects entities org_from[i] and org_to[i] with a strength value of org_weight[i] . A spanning tree in this context is defined as a subset of relationships connecting all entities such that: Every entity is connected to every other either directly or indirectly through a sequence of relationships, and There are exactly org_nodes - 1 relationships in the subset. Find the minimum possible difference between the highest and lowest relationship strength values among all valid spanning trees. If no such spanning tree exists, return -1. Function Description Complete the function getMinimumStrengthDifference in the editor below. The function must return a minimum difference between the maximal and the minimal edge weight of a valid Spanning Tree or -1 if no Sp