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...
-
What are the main differences between biosphere and techno sphere?
-
( GAAP and Economic Consequences) The following letter was sent to the SEC and the FASB by leaders of the business community. Dear Sirs: The FASB has been struggling with accounting for derivatives...
-
Curtis Container Company (CCC) manufactures plastic 2-liter bottles for the beverage industry. The cost standards per 100 2-liter bottles are as follows: At the beginning of May, CCC management...
-
As noted in this chapter, because of global competition, companies have become increasingly focused on reducing costs. To reduce costs and remain competitive, many companies are turning to...
-
Required: A bond currently sells for $1,020, which gives it a yield to maturity of 5%. Suppose that if the yield increases by 25 basis points, the price of the bond falls to $985. What is the...
-
Cecil C. Seymour is a 64-year-old widower. He had income for 2022 as follows: The cost of the annuity was $46,800, and Cecil was expected to receive a total of 260 monthly payments of $450. Cecil has...
-
Indicate the amount of ATP produced by each enzyme or each pathway. Citric acid cycle Glycolysis ATP synthase Complexes I-IV of the electron transport chain Breakdown of pyruvate 2 ATP No ATP 30-34...
-
QUESTION 6 A study is concerned with measuring the technical efficiency of a group of colleges affiliated to a university, using the DEA method. It was limited to three inputs (number of students,...
-
Simpson Energy earned $2.8 million in net income last year and for the first time ever paid its common stockholders a cash dividend of $0.04 per share. The firm has 9.1 million shares outstanding....
-
Describe the communication practices in Madagascar and organizational communication styles.
-
McDonalds What types of technology do they employ AT McDonalds ? (routine/non-routine (how they do it) What are the characteristics of the workforce ? (high/low) In what type of environment ?...
-
Kiso Company purchased a tract of land for $4,500,000 in anticipation of extracting 1,425,000 tons of ore. The residual value of the land is expected to be $480,000. The company mines 125,000 tons of...
-
Find the area between the curve y = x + 11x + 28 and the x-axis from x = -4 to x=-1. (Giv Need Help? Read It Watch It Master It
-
Design an experiment to demonstrate that RNA transcripts are synthesized in the nucleus of eukaryotes and are subsequently transported to the cytoplasm.
-
The accounting profession has been investigated by Congress over a number of years. However, none of the investigations or recommendations for change seems to have made a difference in that fraud...
-
The following two questions directly relate to ethics standards in the AICPA Code of Professional Conduct: a. Is it ever improper for a CPA/CPA firm to accept a commission from a client for...
-
Have you ever agreed to do something when you werent sure that you had the skills to accomplish the job? Why did you agree to do it? Can you draw an analogy between your motivations and the ethical...
Study smarter with the SolutionInn App