We all know that currently, we are going through a pandemic period. Several measures are now...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
We all know that currently, we are going through a pandemic period. Several measures are now taken so that we can overcome this period and resume our daily activities like we did earlier. Educational institutions are trying to resume all activities and they are doing their best to do it successfully. We know that this disease is contagious and anyone affected comes in contact with another person, then he or she needs to stay in quarantine. Suppose an educational institution "X" has hired you to design a system known as an "Infected tracker". An infected tracker tries to figure out the region/number of surrounding people who can be affected by a single person. Then it prints the maximum region infected. Here you can consider Y being infected and N is not infected. Your task is to find the maximum region with Y i.e. max people infected in a region so that strict measures can be taken in that region. Keep in mind that two people are said to be infected if two elements in the matrix are Y horizontally, vertically or diagonally. Sample Input 1 NNNYYNN NYNNYYN YYNYNNY ΝΝΝΝΝΥΝ YYNNNNN NNNYNNN Sample Output 7 Code with Python(.py)--> Topic: BFS & DFS We all know that currently, we are going through a pandemic period. Several measures are now taken so that we can overcome this period and resume our daily activities like we did earlier. Educational institutions are trying to resume all activities and they are doing their best to do it successfully. We know that this disease is contagious and anyone affected comes in contact with another person, then he or she needs to stay in quarantine. Suppose an educational institution "X" has hired you to design a system known as an "Infected tracker". An infected tracker tries to figure out the region/number of surrounding people who can be affected by a single person. Then it prints the maximum region infected. Here you can consider Y being infected and N is not infected. Your task is to find the maximum region with Y i.e. max people infected in a region so that strict measures can be taken in that region. Keep in mind that two people are said to be infected if two elements in the matrix are Y horizontally, vertically or diagonally. Sample Input 1 NNNYYNN NYNNYYN YYNYNNY ΝΝΝΝΝΥΝ YYNNNNN NNNYNNN Sample Output 7 Code with Python(.py)--> Topic: BFS & DFS
Expert Answer:
Posted Date:
Students also viewed these programming questions
-
DFS Corporation is currently an all-equity firm, with assets with a market value of $100 million and 4 million shares outstanding. DFS is considering a leveraged recapitalization to boost its share...
-
Changes in Current Operating Assets and Liabilities-Indirect Method Mohammed Corporation's comparative balance sheet for current assets and liabilities was as follows: Dec. 31, 20Y2 Dec. 31, 20Y1...
-
Python Code class Graph: def __init__(self, graph_repr=None): if graph_repr is None: self.vertList = {} else:self.vertList = graph_repr def addVertex(self,key): if key not in self.vertList:...
-
With reference to the Auditors Report, answer the following questions: The recent final audit report of an FMCG carries a line which is read as in the manner so required and respectively give a true...
-
Jim Springs is the owner and manager of California Car Wash. California Car Wash provides various car wash and car detailing services. California Car Wash also sells snacks and gift items in its...
-
Most large companies have an in-house legal staff that helps the company deal with current and pending legal matters. Often the legal staffs efforts are assisted by outside counsel, especially when...
-
How can management accounting assist in the review of financial performance after an event?
-
Sprint Nextel is one of the largest digital wireless service providers in the United States. In a recent year, it had approximately 41.5 million direct subscribers (accounts) that generated revenue...
-
Your Turn 1. AABC = DEF. Find the length of CA, DE, EF. Find the angle measure of LA, LB,LC. 2.6 cm B 3.7 cm 3.5 cm 42 F 73 A 65 E Since AABC ADEF, these six facts are always true. Corresponding...
-
The Armory Committee was composed of officers from various National Guard units. It organized a New Years Eve dance at a charge of $2 per person to defray costs. Perry, along with others, was a...
-
You are managing a company called Max Sdn Bhd, which uses various equipment to run its operations. This equipment needs to be serviced and repaired from time to time. For the last five years, your...
-
You measure the velocity of falling object at several times given in the table below. Time (s) Velocity (m/s) 0.00 0.10 0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 1.00 0.07 0.99 1.89 2.98 3.87 4.96 5.83...
-
How do organizational change theories such as Lewin's Three-Stage Model and Kotter's Eight-Step Process adapt to accommodate the complexities of globalized, digitally-enabled business environments ?
-
Dowling Sportswear is considering building a new factory to produce aluminum baseball bats. This project would require an initial cash outlay of $4,000,000 and would generate annual net cash inflows...
-
A crude approximation of a water molecule is as three point charges of charge +e, +e, and -2e representing the hydrogen and oxygen atoms, respectively, with a bond angle of 104.5" and a distance...
-
Assume you were the fraud investigator in the case of KEVIN CHIU, a former business relationship manager at a financial institution headquartered in Manhattan where he was charged with stealing...
-
Louie's Lawn Service Worksheet For Month Ended March 31, 20 -- TRIAL 1 BALANCE TRIAL BALANCE ADJUSTMENTS ADJUSTMENTS 2 ACCOUNT TITLE DEBIT CREDIT DEBIT CREDIT Cash 1,375.00 4 Accounts Receivable...
-
Design an experiment to demonstrate that RNA transcripts are synthesized in the nucleus of eukaryotes and are subsequently transported to the cytoplasm.
-
Lomax Company reported the following costs on its financial statements (in thousands): REQUIRED: Using the reserve disclosure for Lomax Company in problem 13 and the data presented in this problem,...
-
Lomax Companys Statement No. 69 disclosures included the following information: REQUIRED: Using the information for Lomax Company in problems 13, 14, and 15 and in this problem: a. Compute the value...
-
Lomax Company reported the following expenses in its financial statements (in thousands): REQUIRED: Using the reserve disclosure for Lomax Company given in problem 13 and the data presented in this...
Study smarter with the SolutionInn App