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 NYΝNYΥΝ ΥYNYNNY. NNNNNYN ΥYNNNN NNNYNNN Sample Output 7

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

Please solve this with Python(.py)-->
I put the explanation as well. Thank you. 
Topic: BFS/DFS

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
NYNNYΥΝ
YYNYNNY
NNNNNYN
ΥYNN Ν
NNNYNNN
Sample Output
7
%3D
ii
Transcribed Image Text: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 NYNNYΥΝ YYNYNNY NNNNNYN ΥYNN Ν NNNYNNN Sample Output 7 %3D ii
Explanation
N
N
N
Y
Y
N
N
N
Y
N
N
Y
Y
N
Y
Y
N
Y
N
N
Y
N
N
N
N
N
Y
N
Y
Y
N
N
N
N
N
N
N
N
Y
N
N
N
Here you can see a region has 7 infected people so it is the maximum infected region.
Sample Input 2:
ΥYNN
NYYNΝ
NNYNN
YNNNN
Sample Output
II
II
II
II
ID
II
II
II
%3D
ID
II
II
II
II
II
II
ii
Transcribed Image Text:Explanation N N N Y Y N N N Y N N Y Y N Y Y N Y N N Y N N N N N Y N Y Y N N N N N N N N Y N N N Here you can see a region has 7 infected people so it is the maximum infected region. Sample Input 2: ΥYNN NYYNΝ NNYNN YNNNN Sample Output II II II II ID II II II %3D ID II II II II II II ii
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Binary numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education