HarshCasper / NeoAlgo

Bringing all Data Structures and Algorithms under one Roof ⚑
MIT License
875 stars 1.05k forks source link

Ninja And Cities #7516

Closed ishwari20 closed 3 years ago

ishwari20 commented 3 years ago

πŸ’₯ Proposal

Ninja decided to find the distance between the neighbouring cities and then store them for future use. He took data from the map and developed an input format. He is given an integer β€˜N’ denoting the number of cities and then he has an array of size β€˜N - 1’ that stores a pair of numbers at each index. Let the pair be β€˜I1’ and β€˜I2’, which will denote a bidirectional edge between the two cities β€˜I1’ and β€˜I2’. A subtree is a subset of cities, where each city can be reached from every other city of the subset. The path between each pair passes only though the cities present in the subset. Two subtrees are taken differently if there are one or more cities in one subtree not present in the other. Now, you need to create an array of β€˜N - 1’ elements where the β€˜ith’ element is the number of subtrees in which the maximum distance between any two cities is equal to β€˜i’.

Have you read the Contributing Guidelines on Pull Requests?

Yes

github-actions[bot] commented 3 years ago

Hello @ishwari20,
Thank you for opening an issue. :partying_face:
To get assigned to this particular issue please use /assign
Check this guide before contributing.

ishwari20 commented 3 years ago

/assign

github-actions[bot] commented 3 years ago

This issue has been assigned to @ishwari20! It will become unassigned if it isn't closed within 12 days. A maintainer can also add the pinned label to prevent it from being unassigned.