This is a verified interview question from Flipkart-grid. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Type B Cities - Flipkart Grid 7.0" covers key patterns like Graphs.
"A new virus is causing illness across the globe. Healthcare workers need to wear personal protective equipment (PPE) to save themselves from the virus, but there is a shortage of PPE across the country. To help get PPE to places where it is needed most, the Government has come up with a plan. All major cities have been classified into three types and a connectivity map has been prepared to Type A cities directly, and Type C are all the remaining cities. Type A cities are the most important for both economy and supply chain. They have a unique characteristic that if a type A city gets locked down, then the map breaks down into two or more sub maps such that there is no connectivity between the two submaps. Because of this, all Type A cities were provided PPE on a war footing. Now it is the turn of Type B cities to get the PPE. Write a program to identify all the Type B cities, given a map of all the cities and their connectivity with other cities. [](https://res.cloudinary.com/dc1rsg5t9/image/upload/a_-45,co_white,fl_layer_apply,g_center,l_text:Arial_80_bold:Codinzhub,o_20/v1782662902/oa_hub_uploads/wyafby4h2schyaryvgmz.jpg) [](https://res.cloudinary.com/dc1rsg5t9/image/upload/a_-45,co_white,fl_layer_apply,g_center,l_text:Arial_80_bold:Codinzhub,o_20/v1782662902/oa_hub_uploads/n3wtnrfekhgam3bwqvx7.jpg) [](https://res.cloudinary.com/dc1rsg5t9/image/upload/a_-45,co_white,fl_layer_apply,g_center,l_text:Arial_80_bold:Codinzhub,o_20/v1782662902/oa_hub_uploads/ufrfhhxstyvvv9sncvtb.jpg)"
Join thousands of developers practicing for Flipkart-grid.