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 sources of potential conflict during organizational entry? How can they be avoided?
-
Why is a working knowledge of OB important to organizations and their employees?
-
Mcfadzean and Honarzad run a farmers' market stall as a partnership. Honarzad withdrew \($26\) 300 cash on 25 October 2025. Mcfadzean withdrew \($17\) 500 on 28 November 2025. On 1 April 2026...
-
1. Describe the strategic management process at Microsoft. How are strategic decisions made? What are the strengths and weaknesses of this approach? 2. Explain the role of organizational inertia in...
-
1. In the system shown in figure, all surfaces are smooth. Rod is moved by external agent with acceleration 0.9 ms vertically downwards. Force exerted on the rod by the wedge will be Newtons.
-
Finley Heaters Inc. is a mid sized manufacturer of residential water heaters. Sales have grown during the last several years, and the companys production capacity needs to be increased. The companys...
-
The tone of your business messages can range from informal to conversational to formal. Part of the challenge of communicating on the job is to analyze each situation and figure out the appropriate...
-
Dragster drivers have to avoid supplying too much power to the vehicle because too much power causes the front end to rise in a "wheelie," compromising steering control. (a) Why does this happen? (b)...
-
In Problems 20-52: a. State the type; and \(\mathbf{b}\). Answer the question. What deposit today is equal to 33 annual deposits of \(\$ 500\) into an account paying \(2 \%\) compounded annually?
-
Anns batting average for the first half of the softball season is higher than Brets, and Anns batting average for the second half of the season is higher than Brets. It follows that Anns batting...
-
The angular momentum of the propellers of a small airplane points directly forward from the plane. (a) In what direction do the propellers rotate as seen from the rear of the plane? (b) If the plane...
-
Standing on a round raft floating on a pond, how do you turn the raft around \(180^{\circ}\) ?
-
Which part of the sentence given below has an error in it? Social media has been / at the recieving end / of a lot of flak recently. Social media has been O of a lot of flak recently A. B. C. O at...
-
Using (1) or (2), find L(f) if f(t) if equals: t cos 4t
-
A particle moves on a predetermined trajectory with the equation of motion \(s(t)=k t^{2}\), with \(k\) constant and with magnitude of the acceleration equal to \(a=2 k\). Show by using (3.74) that...
-
In the case considered in the question (14), show what the trajectory corresponds to in case the magnitude of acceleration is \(a=2 k \sqrt{1+\frac{t}{T}}\), where \(T=\) cost. Question 14 A particle...
-
The position vector along a trajectory expressed in terms of the scalar distance \(s\) from the origin is given by the relation \(\mathbf{r}=\mathbf{a} s^{2}+\mathbf{b} s+\mathbf{c}\), with the...
Study smarter with the SolutionInn App