Company: Uber_2oct
Difficulty: hard
Maximum Groups for Bilateral Cab Zones A cab service company is studying n new cities to decide where cab service zones should be set up. The cities are labelled from 1 to n . The company has a list of roads connecting these cities, edges , where edges[i] = [ai, bi] means there is a bidirectional road between city ai and city bi , which makes the two cities neighbours of each other. The cities may belong to different countries and continents. The company wants to try out the Bilateral Approach , which says that if a cab service zone is set up in a city then there is no need for a zone in any of its neighbouring cities. So if there is a road from a to b , one from b to c and one from a to d , and a zone is set up in a , then there should be no zone in b and d because they are neighbours of a , but c should have a zone. One city can have only one zone. They want to split the cities into m groups, numbered from 1 , so that every city belongs to exactly one group and the approach above can