AMAZON, MICROSOFT + More – Coding Question

10 Live
Vaccination Drive In order to curb the spread of the novel COVID-19 virus, the citizens of Hackerland need to be vaccinated on priority. There are center_nodes vaccination centers in Hackerland, where each center has a status denoted by status[i]: β€’ Centers with a shortage of vaccines have status 1. β€’ Those with sufficient vaccines have status 2. β€’ Those with a surplus have status 3. Vaccines can be transferred from centers with a surplus to centers with a deficit. There is a network of bidirectional roads between centers where the ith road is between cities center_from[i] and center_to[i]. Each road takes 1 unit of time to traverse. Find the minimum time in which all deficient centers can receive a supply of vaccines from some surplus center. Note: β€’ Surplus centers have an inexhaustible supply of vaccines. β€’ Multiple surplus centers can ship their surplus simultaneously. β€’ Multiple deliveries from a single surplus center can leave simultaneously. β€’ Vaccines are only shipped from centers with status 3 to centers with status 1. Status 2 centers do nothing.

Asked in: AMAZON MICROSOFT JUSPAY

Image of the Question

Question Image Question Image

All Testcases Passed βœ”



Passcode Image

Solution


Please login to view the solution


Related Questions

| Given an n x m grid, where rows are numbered from 7 to n and columns from 1 to … |
| There are 'N' coders standing in a line, where i denotes the ith position of a … |
| A birthday party was attended by N number of kids, and each kid was given a uni… |
| Given a matrix of size m * n, where m denotes the number of rows (starting with… |
| A traveler is traveling from the city of Zeta to Omega. He starts with X amount… |
| As an operations engineer at Amazon, you are responsible for organizing the dis… |