Company: flipkart-grid-8.0
Difficulty: medium
There are N locations in a city that need to be connected with drone pathways to transfer medical aid during emergencies. Each location needs to be connected with all the other N-1 locations. Some of these pathways are already built, while the rest need to be constructed now. Due to the peculiarity of the technology used in the pathways, whenever new pathways from a location are constructed, all the pre-existing pathways from that location get destroyed. For instance, if from location 4 drone pathways exist towards locations 1 & 2, but not towards location 3, then once you construct a drone pathway from location 4 to location 3, the pre-existing pathways from location 4 to locations 1 & 2 get destroyed. The citizens of the city are eagerly awaiting "Complete Day" , a day when drone pathways exist between all the locations in the city. Every day they choose one of the N locations, and build all the missing pathways from that location, in the process destroying the pre-existing p