There is an Alien(Xenomorph) Apocalypse in XCITY and every minute Aliens are attacking human beings around them. Imagine XCITY as a grid where "A" represents the position of an Alien, "H" represents the position of a human being and "T" represents heat traps set up by humans which the Aliens cannot cross. The regions of the Aliens will not overlap, i.e. two or more Aliens will never have a common human to prey on. An Alien can attack human beings on it's north,south,east and west simultaneously using its deadly advanced physical attributes. A human being becomes a host after an attack and a new Alien spawns in that position. Your task is to find out the minimum number of minutes it would take for the Aliens to attack all the humans around them. Also, print "No one survived" if no human beings survive the Apocalypse or "number_of_human_beings survived" otherwise.
muballighhossain / bfs-python Goto Github PK
View Code? Open in Web Editor NEWThere is an Alien(Xenomorph) Apocalypse in XCITY and every minute Aliens are attacking human beings around them. Imagine XCITY as a grid where "A" represents the position of an Alien, "H" represents the position of a human being and "T" represents heat traps set up by humans which the Aliens cannot cross. The regions of the Aliens will not overlap, i.e. two or more Aliens will never have a common human to prey on. An Alien can attack human beings on it's north,south,east and west simultaneously using its deadly advanced physical attributes. A human being becomes a host after an attack and a new Alien spawns in that position. Your task is to find out the minimum number of minutes it would take for the Aliens to attack all the humans around them. Also, print "No one survived" if no human beings survive the Apocalypse or "number_of_human_beings survived" otherwise.