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 hints

Topics

Also asked at 2 companies


More ServiceNow Questions

View all ServiceNow questions