Find Minimum Diameter After Merging Two Trees at ServiceNow
Hard57.1% acceptance
This problem has 87.5% frequency at ServiceNow.
Problem Description
There exist two **undirected** trees with `n` and `m` nodes, numbered from `0` to `n - 1` and from `0` to `m - 1`, respectively. You are given two 2D integer arrays `edges1` and `edges2` of lengths `n - 1` and `m - 1`, respectively, where `edges1[i] = [ai, bi]` indicates that there is an edge betwee...
Read full problem and hintsTopics
Also asked at 2 companies
More ServiceNow Questions
Number of IslandsMediumPacific Atlantic Water FlowMediumCoin ChangeMediumRotting OrangesMediumAmount of Time for Binary Tree to Be InfectedMedium
View all ServiceNow questions