Question 1
Medium There are n machines labeled 1 to n and a list of existing bidirectional connections. A message can travel at most ttl hops. Return the minimum number of new connections needed so that every pair of machines can reach each other within ttl hops. Example 1: n = 4, connections = [[1, 2], [2, 3]], ttl = 1 gives 4, because every pair must be directly connected and 2 of the required connections already exist, so 4 more are needed.